sdc-build-wp 4.1.0 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/composer.json +2 -3
  2. package/composer.lock +3 -313
  3. package/index.js +38 -21
  4. package/lib/blocks.js +8 -6
  5. package/lib/style.js +17 -0
  6. package/package.json +1 -1
  7. package/vendor/composer/autoload_classmap.php +0 -37
  8. package/vendor/composer/autoload_psr4.php +0 -1
  9. package/vendor/composer/autoload_real.php +2 -0
  10. package/vendor/composer/autoload_static.php +0 -53
  11. package/vendor/composer/installed.json +1 -329
  12. package/vendor/composer/installed.php +3 -39
  13. package/vendor/composer/platform_check.php +26 -0
  14. package/lib/bustCache.js +0 -14
  15. package/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md +0 -22
  16. package/vendor/dealerdirect/phpcodesniffer-composer-installer/README.md +0 -285
  17. package/vendor/dealerdirect/phpcodesniffer-composer-installer/composer.json +0 -71
  18. package/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php +0 -637
  19. package/vendor/phpcsstandards/phpcsextra/CHANGELOG.md +0 -590
  20. package/vendor/phpcsstandards/phpcsextra/LICENSE +0 -165
  21. package/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml +0 -40
  22. package/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php +0 -382
  23. package/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml +0 -5
  24. package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml +0 -94
  25. package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml +0 -43
  26. package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php +0 -305
  27. package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php +0 -226
  28. package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml +0 -5
  29. package/vendor/phpcsstandards/phpcsextra/README.md +0 -573
  30. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml +0 -27
  31. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml +0 -44
  32. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml +0 -40
  33. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml +0 -31
  34. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml +0 -24
  35. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml +0 -25
  36. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml +0 -27
  37. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml +0 -23
  38. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml +0 -25
  39. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml +0 -64
  40. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml +0 -26
  41. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml +0 -27
  42. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml +0 -25
  43. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml +0 -43
  44. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml +0 -23
  45. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml +0 -30
  46. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml +0 -25
  47. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml +0 -35
  48. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml +0 -49
  49. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml +0 -37
  50. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml +0 -45
  51. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml +0 -42
  52. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml +0 -33
  53. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml +0 -23
  54. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml +0 -23
  55. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml +0 -27
  56. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml +0 -25
  57. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml +0 -27
  58. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml +0 -27
  59. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml +0 -23
  60. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml +0 -27
  61. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml +0 -31
  62. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml +0 -30
  63. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml +0 -26
  64. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml +0 -44
  65. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml +0 -29
  66. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml +0 -33
  67. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml +0 -25
  68. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml +0 -41
  69. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml +0 -39
  70. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml +0 -25
  71. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml +0 -25
  72. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml +0 -25
  73. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml +0 -29
  74. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml +0 -25
  75. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml +0 -23
  76. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml +0 -30
  77. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml +0 -31
  78. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml +0 -94
  79. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml +0 -25
  80. package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml +0 -29
  81. package/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php +0 -60
  82. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php +0 -89
  83. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php +0 -297
  84. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php +0 -174
  85. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php +0 -134
  86. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php +0 -112
  87. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php +0 -116
  88. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php +0 -188
  89. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php +0 -81
  90. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php +0 -102
  91. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php +0 -211
  92. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php +0 -153
  93. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php +0 -269
  94. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php +0 -131
  95. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php +0 -216
  96. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php +0 -106
  97. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php +0 -199
  98. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php +0 -89
  99. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php +0 -216
  100. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php +0 -348
  101. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php +0 -164
  102. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php +0 -190
  103. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php +0 -233
  104. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php +0 -120
  105. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php +0 -71
  106. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php +0 -86
  107. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php +0 -81
  108. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php +0 -80
  109. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php +0 -81
  110. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php +0 -96
  111. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php +0 -190
  112. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php +0 -275
  113. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php +0 -204
  114. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php +0 -112
  115. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php +0 -76
  116. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php +0 -197
  117. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php +0 -116
  118. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php +0 -85
  119. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php +0 -87
  120. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php +0 -101
  121. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php +0 -248
  122. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php +0 -211
  123. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php +0 -211
  124. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php +0 -211
  125. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php +0 -207
  126. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php +0 -156
  127. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php +0 -170
  128. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php +0 -155
  129. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php +0 -79
  130. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php +0 -408
  131. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php +0 -173
  132. package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php +0 -445
  133. package/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml +0 -5
  134. package/vendor/phpcsstandards/phpcsextra/composer.json +0 -69
  135. package/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist +0 -36
  136. package/vendor/phpcsstandards/phpcsutils/CHANGELOG.md +0 -1106
  137. package/vendor/phpcsstandards/phpcsutils/LICENSE +0 -165
  138. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php +0 -551
  139. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php +0 -781
  140. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php +0 -123
  141. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php +0 -202
  142. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php +0 -44
  143. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php +0 -47
  144. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php +0 -43
  145. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php +0 -50
  146. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php +0 -246
  147. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php +0 -218
  148. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php +0 -687
  149. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php +0 -269
  150. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php +0 -164
  151. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php +0 -75
  152. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php +0 -459
  153. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php +0 -837
  154. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php +0 -55
  155. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php +0 -227
  156. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php +0 -156
  157. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php +0 -232
  158. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php +0 -276
  159. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php +0 -828
  160. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php +0 -262
  161. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php +0 -359
  162. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php +0 -145
  163. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php +0 -389
  164. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php +0 -116
  165. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php +0 -322
  166. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php +0 -359
  167. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php +0 -252
  168. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php +0 -120
  169. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php +0 -419
  170. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php +0 -510
  171. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php +0 -143
  172. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php +0 -331
  173. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php +0 -432
  174. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php +0 -333
  175. package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml +0 -4
  176. package/vendor/phpcsstandards/phpcsutils/README.md +0 -297
  177. package/vendor/phpcsstandards/phpcsutils/composer.json +0 -92
  178. package/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php +0 -68
  179. package/vendor/wp-coding-standards/wpcs/CHANGELOG.md +0 -1654
  180. package/vendor/wp-coding-standards/wpcs/LICENSE +0 -21
  181. package/vendor/wp-coding-standards/wpcs/README.md +0 -261
  182. package/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php +0 -261
  183. package/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php +0 -257
  184. package/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php +0 -111
  185. package/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php +0 -358
  186. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml +0 -116
  187. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml +0 -31
  188. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml +0 -50
  189. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml +0 -24
  190. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml +0 -35
  191. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml +0 -54
  192. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml +0 -119
  193. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml +0 -35
  194. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml +0 -121
  195. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml +0 -40
  196. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml +0 -53
  197. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml +0 -27
  198. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml +0 -23
  199. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml +0 -69
  200. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml +0 -43
  201. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml +0 -23
  202. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml +0 -45
  203. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml +0 -23
  204. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml +0 -23
  205. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml +0 -23
  206. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml +0 -40
  207. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml +0 -92
  208. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml +0 -57
  209. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml +0 -73
  210. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml +0 -27
  211. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml +0 -150
  212. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml +0 -19
  213. package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml +0 -61
  214. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php +0 -108
  215. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php +0 -135
  216. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php +0 -394
  217. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php +0 -84
  218. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php +0 -256
  219. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php +0 -60
  220. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php +0 -238
  221. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php +0 -101
  222. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php +0 -159
  223. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php +0 -122
  224. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php +0 -73
  225. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php +0 -418
  226. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php +0 -60
  227. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/UnslashingFunctionsHelper.php +0 -59
  228. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php +0 -349
  229. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php +0 -262
  230. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php +0 -115
  231. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php +0 -312
  232. package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php +0 -113
  233. package/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php +0 -72
  234. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php +0 -252
  235. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php +0 -550
  236. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php +0 -174
  237. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php +0 -583
  238. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php +0 -173
  239. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php +0 -89
  240. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php +0 -301
  241. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php +0 -761
  242. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php +0 -242
  243. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php +0 -57
  244. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php +0 -63
  245. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php +0 -58
  246. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php +0 -168
  247. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php +0 -59
  248. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php +0 -313
  249. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php +0 -1297
  250. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php +0 -188
  251. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php +0 -277
  252. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php +0 -230
  253. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php +0 -289
  254. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php +0 -63
  255. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php +0 -100
  256. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php +0 -52
  257. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php +0 -193
  258. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php +0 -245
  259. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php +0 -73
  260. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php +0 -70
  261. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php +0 -45
  262. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php +0 -122
  263. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php +0 -90
  264. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php +0 -124
  265. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php +0 -903
  266. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php +0 -422
  267. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php +0 -126
  268. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php +0 -45
  269. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php +0 -244
  270. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php +0 -862
  271. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php +0 -371
  272. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php +0 -478
  273. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php +0 -315
  274. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php +0 -897
  275. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php +0 -321
  276. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php +0 -152
  277. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php +0 -1708
  278. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php +0 -291
  279. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php +0 -509
  280. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php +0 -160
  281. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php +0 -54
  282. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php +0 -241
  283. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php +0 -108
  284. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php +0 -436
  285. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php +0 -977
  286. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php +0 -102
  287. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php +0 -59
  288. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +0 -486
  289. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +0 -63
  290. package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php +0 -60
  291. package/vendor/wp-coding-standards/wpcs/WordPress/ruleset.xml +0 -13
  292. package/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml +0 -948
  293. package/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml +0 -109
  294. package/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml +0 -199
  295. package/vendor/wp-coding-standards/wpcs/composer.json +0 -88
  296. package/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample +0 -153
@@ -1,165 +0,0 @@
1
- GNU LESSER GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
-
9
- This version of the GNU Lesser General Public License incorporates
10
- the terms and conditions of version 3 of the GNU General Public
11
- License, supplemented by the additional permissions listed below.
12
-
13
- 0. Additional Definitions.
14
-
15
- As used herein, "this License" refers to version 3 of the GNU Lesser
16
- General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
- General Public License.
18
-
19
- "The Library" refers to a covered work governed by this License,
20
- other than an Application or a Combined Work as defined below.
21
-
22
- An "Application" is any work that makes use of an interface provided
23
- by the Library, but which is not otherwise based on the Library.
24
- Defining a subclass of a class defined by the Library is deemed a mode
25
- of using an interface provided by the Library.
26
-
27
- A "Combined Work" is a work produced by combining or linking an
28
- Application with the Library. The particular version of the Library
29
- with which the Combined Work was made is also called the "Linked
30
- Version".
31
-
32
- The "Minimal Corresponding Source" for a Combined Work means the
33
- Corresponding Source for the Combined Work, excluding any source code
34
- for portions of the Combined Work that, considered in isolation, are
35
- based on the Application, and not on the Linked Version.
36
-
37
- The "Corresponding Application Code" for a Combined Work means the
38
- object code and/or source code for the Application, including any data
39
- and utility programs needed for reproducing the Combined Work from the
40
- Application, but excluding the System Libraries of the Combined Work.
41
-
42
- 1. Exception to Section 3 of the GNU GPL.
43
-
44
- You may convey a covered work under sections 3 and 4 of this License
45
- without being bound by section 3 of the GNU GPL.
46
-
47
- 2. Conveying Modified Versions.
48
-
49
- If you modify a copy of the Library, and, in your modifications, a
50
- facility refers to a function or data to be supplied by an Application
51
- that uses the facility (other than as an argument passed when the
52
- facility is invoked), then you may convey a copy of the modified
53
- version:
54
-
55
- a) under this License, provided that you make a good faith effort to
56
- ensure that, in the event an Application does not supply the
57
- function or data, the facility still operates, and performs
58
- whatever part of its purpose remains meaningful, or
59
-
60
- b) under the GNU GPL, with none of the additional permissions of
61
- this License applicable to that copy.
62
-
63
- 3. Object Code Incorporating Material from Library Header Files.
64
-
65
- The object code form of an Application may incorporate material from
66
- a header file that is part of the Library. You may convey such object
67
- code under terms of your choice, provided that, if the incorporated
68
- material is not limited to numerical parameters, data structure
69
- layouts and accessors, or small macros, inline functions and templates
70
- (ten or fewer lines in length), you do both of the following:
71
-
72
- a) Give prominent notice with each copy of the object code that the
73
- Library is used in it and that the Library and its use are
74
- covered by this License.
75
-
76
- b) Accompany the object code with a copy of the GNU GPL and this license
77
- document.
78
-
79
- 4. Combined Works.
80
-
81
- You may convey a Combined Work under terms of your choice that,
82
- taken together, effectively do not restrict modification of the
83
- portions of the Library contained in the Combined Work and reverse
84
- engineering for debugging such modifications, if you also do each of
85
- the following:
86
-
87
- a) Give prominent notice with each copy of the Combined Work that
88
- the Library is used in it and that the Library and its use are
89
- covered by this License.
90
-
91
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
- document.
93
-
94
- c) For a Combined Work that displays copyright notices during
95
- execution, include the copyright notice for the Library among
96
- these notices, as well as a reference directing the user to the
97
- copies of the GNU GPL and this license document.
98
-
99
- d) Do one of the following:
100
-
101
- 0) Convey the Minimal Corresponding Source under the terms of this
102
- License, and the Corresponding Application Code in a form
103
- suitable for, and under terms that permit, the user to
104
- recombine or relink the Application with a modified version of
105
- the Linked Version to produce a modified Combined Work, in the
106
- manner specified by section 6 of the GNU GPL for conveying
107
- Corresponding Source.
108
-
109
- 1) Use a suitable shared library mechanism for linking with the
110
- Library. A suitable mechanism is one that (a) uses at run time
111
- a copy of the Library already present on the user's computer
112
- system, and (b) will operate properly with a modified version
113
- of the Library that is interface-compatible with the Linked
114
- Version.
115
-
116
- e) Provide Installation Information, but only if you would otherwise
117
- be required to provide such information under section 6 of the
118
- GNU GPL, and only to the extent that such information is
119
- necessary to install and execute a modified version of the
120
- Combined Work produced by recombining or relinking the
121
- Application with a modified version of the Linked Version. (If
122
- you use option 4d0, the Installation Information must accompany
123
- the Minimal Corresponding Source and Corresponding Application
124
- Code. If you use option 4d1, you must provide the Installation
125
- Information in the manner specified by section 6 of the GNU GPL
126
- for conveying Corresponding Source.)
127
-
128
- 5. Combined Libraries.
129
-
130
- You may place library facilities that are a work based on the
131
- Library side by side in a single library together with other library
132
- facilities that are not Applications and are not covered by this
133
- License, and convey such a combined library under terms of your
134
- choice, if you do both of the following:
135
-
136
- a) Accompany the combined library with a copy of the same work based
137
- on the Library, uncombined with any other library facilities,
138
- conveyed under the terms of this License.
139
-
140
- b) Give prominent notice with the combined library that part of it
141
- is a work based on the Library, and explaining where to find the
142
- accompanying uncombined form of the same work.
143
-
144
- 6. Revised Versions of the GNU Lesser General Public License.
145
-
146
- The Free Software Foundation may publish revised and/or new versions
147
- of the GNU Lesser General Public License from time to time. Such new
148
- versions will be similar in spirit to the present version, but may
149
- differ in detail to address new problems or concerns.
150
-
151
- Each version is given a distinguishing version number. If the
152
- Library as you received it specifies that a certain numbered version
153
- of the GNU Lesser General Public License "or any later version"
154
- applies to it, you have the option of following the terms and
155
- conditions either of that published version or of any later version
156
- published by the Free Software Foundation. If the Library as you
157
- received it does not specify a version number of the GNU Lesser
158
- General Public License, you may choose any version of the GNU Lesser
159
- General Public License ever published by the Free Software Foundation.
160
-
161
- If the Library as you received it specifies that a proxy can decide
162
- whether future versions of the GNU Lesser General Public License shall
163
- apply, that proxy's public statement of acceptance of any version is
164
- permanent authorization for you to choose that version for the
165
- Library.
@@ -1,40 +0,0 @@
1
- <?xml version="1.0"?>
2
- <documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
- xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
4
- title="Function Calls to Dirname"
5
- >
6
- <standard>
7
- <![CDATA[
8
- PHP >= 5.3: Usage of dirname(__FILE__) can be replaced with __DIR__.
9
- ]]>
10
- </standard>
11
- <code_comparison>
12
- <code title="Valid: Using __DIR__.">
13
- <![CDATA[
14
- $path = <em>__DIR__</em>;
15
- ]]>
16
- </code>
17
- <code title="Invalid: dirname(__FILE__).">
18
- <![CDATA[
19
- $path = <em>dirname(__FILE__)</em>;
20
- ]]>
21
- </code>
22
- </code_comparison>
23
- <standard>
24
- <![CDATA[
25
- PHP >= 7.0: Nested calls to dirname() can be replaced by using dirname() with the $levels parameter.
26
- ]]>
27
- </standard>
28
- <code_comparison>
29
- <code title="Valid: Using dirname() with the $levels parameter.">
30
- <![CDATA[
31
- $path = <em>dirname($file, 3)</em>;
32
- ]]>
33
- </code>
34
- <code title="Invalid: Nested function calls to dirname().">
35
- <![CDATA[
36
- $path = <em>dirname(dirname(dirname($file)))</em>;
37
- ]]>
38
- </code>
39
- </code_comparison>
40
- </documentation>
@@ -1,382 +0,0 @@
1
- <?php
2
- /**
3
- * PHPCSExtra, a collection of sniffs and standards for use with PHP_CodeSniffer.
4
- *
5
- * @package PHPCSExtra
6
- * @copyright 2020 PHPCSExtra Contributors
7
- * @license https://opensource.org/licenses/LGPL-3.0 LGPL3
8
- * @link https://github.com/PHPCSStandards/PHPCSExtra
9
- */
10
-
11
- namespace PHPCSExtra\Modernize\Sniffs\FunctionCalls;
12
-
13
- use PHP_CodeSniffer\Files\File;
14
- use PHP_CodeSniffer\Sniffs\Sniff;
15
- use PHP_CodeSniffer\Util\Tokens;
16
- use PHPCSUtils\BackCompat\Helper;
17
- use PHPCSUtils\Tokens\Collections;
18
- use PHPCSUtils\Utils\Context;
19
- use PHPCSUtils\Utils\PassedParameters;
20
-
21
- /**
22
- * Detect `dirname(__FILE__)` and nested uses of `dirname()`.
23
- *
24
- * @since 1.0.0
25
- */
26
- final class DirnameSniff implements Sniff
27
- {
28
-
29
- /**
30
- * PHP version as configured or 0 if unknown.
31
- *
32
- * @since 1.1.1
33
- *
34
- * @var int
35
- */
36
- private $phpVersion;
37
-
38
- /**
39
- * Registers the tokens that this sniff wants to listen for.
40
- *
41
- * @since 1.0.0
42
- *
43
- * @return array<int|string>
44
- */
45
- public function register()
46
- {
47
- return [\T_STRING];
48
- }
49
-
50
- /**
51
- * Processes this test, when one of its tokens is encountered.
52
- *
53
- * @since 1.0.0
54
- *
55
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
56
- * @param int $stackPtr The position of the current token
57
- * in the stack passed in $tokens.
58
- *
59
- * @return void
60
- */
61
- public function process(File $phpcsFile, $stackPtr)
62
- {
63
- if (isset($this->phpVersion) === false || \defined('PHP_CODESNIFFER_IN_TESTS')) {
64
- // Set default value to prevent this code from running every time the sniff is triggered.
65
- $this->phpVersion = 0;
66
-
67
- $phpVersion = Helper::getConfigData('php_version');
68
- if ($phpVersion !== null) {
69
- $this->phpVersion = (int) $phpVersion;
70
- }
71
- }
72
-
73
- if ($this->phpVersion !== 0 && $this->phpVersion < 50300) {
74
- // PHP version too low, nothing to do.
75
- return;
76
- }
77
-
78
- $tokens = $phpcsFile->getTokens();
79
-
80
- if (\strtolower($tokens[$stackPtr]['content']) !== 'dirname') {
81
- // Not our target.
82
- return;
83
- }
84
-
85
- $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
86
- if ($nextNonEmpty === false
87
- || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS
88
- || isset($tokens[$nextNonEmpty]['parenthesis_owner']) === true
89
- ) {
90
- // Not our target.
91
- return;
92
- }
93
-
94
- if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) {
95
- // Live coding or parse error, ignore.
96
- return;
97
- }
98
-
99
- if (Context::inAttribute($phpcsFile, $stackPtr) === true) {
100
- // Class instantiation in attribute, not function call.
101
- return;
102
- }
103
-
104
- // Check if it is really a function call to the global function.
105
- $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);
106
-
107
- if (isset(Collections::objectOperators()[$tokens[$prevNonEmpty]['code']]) === true
108
- || $tokens[$prevNonEmpty]['code'] === \T_NEW
109
- ) {
110
- // Method call, class instantiation or other "not our target".
111
- return;
112
- }
113
-
114
- if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR) {
115
- $prevPrevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true);
116
- if ($tokens[$prevPrevToken]['code'] === \T_STRING
117
- || $tokens[$prevPrevToken]['code'] === \T_NAMESPACE
118
- ) {
119
- // Namespaced function.
120
- return;
121
- }
122
- }
123
-
124
- /*
125
- * As of here, we can be pretty sure this is a function call to the global function.
126
- */
127
- $opener = $nextNonEmpty;
128
- $closer = $tokens[$nextNonEmpty]['parenthesis_closer'];
129
-
130
- $parameters = PassedParameters::getParameters($phpcsFile, $stackPtr);
131
- $paramCount = \count($parameters);
132
- if (empty($parameters) || $paramCount > 2) {
133
- // No parameters or too many parameter.
134
- return;
135
- }
136
-
137
- $pathParam = PassedParameters::getParameterFromStack($parameters, 1, 'path');
138
- if ($pathParam === false) {
139
- // If the path parameter doesn't exist, there's nothing to do.
140
- return;
141
- }
142
-
143
- $levelsParam = PassedParameters::getParameterFromStack($parameters, 2, 'levels');
144
- if ($levelsParam === false && $paramCount === 2) {
145
- // There must be a typo in the param name or an otherwise stray parameter. Ignore.
146
- return;
147
- }
148
-
149
- /*
150
- * PHP 5.3+: Detect use of dirname(__FILE__).
151
- */
152
- if (\strtoupper($pathParam['clean']) === '__FILE__') {
153
- $levelsValue = false;
154
-
155
- // Determine if the issue is auto-fixable.
156
- $hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($opener + 1), $closer);
157
- $fixable = ($hasComment === false);
158
-
159
- if ($fixable === true) {
160
- $levelsValue = $this->getLevelsValue($phpcsFile, $levelsParam);
161
- if ($levelsParam !== false && $levelsValue === false) {
162
- // Can't autofix if we don't know the value of the $levels parameter.
163
- $fixable = false;
164
- }
165
- }
166
-
167
- $error = 'Use the __DIR__ constant instead of calling dirname(__FILE__) (PHP >= 5.3)';
168
- $code = 'FileConstant';
169
-
170
- // Throw the error.
171
- if ($fixable === false) {
172
- $phpcsFile->addError($error, $stackPtr, $code);
173
- return;
174
- }
175
-
176
- $fix = $phpcsFile->addFixableError($error, $stackPtr, $code);
177
- if ($fix === true) {
178
- if ($levelsParam === false || $levelsValue === 1) {
179
- // No $levels or $levels set to 1: we can replace the complete function call.
180
- $phpcsFile->fixer->beginChangeset();
181
-
182
- $phpcsFile->fixer->replaceToken($stackPtr, '__DIR__');
183
-
184
- for ($i = ($stackPtr + 1); $i <= $closer; $i++) {
185
- $phpcsFile->fixer->replaceToken($i, '');
186
- }
187
-
188
- // Remove potential leading \.
189
- if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR) {
190
- $phpcsFile->fixer->replaceToken($prevNonEmpty, '');
191
- }
192
-
193
- $phpcsFile->fixer->endChangeset();
194
- } else {
195
- // We can replace the $path parameter and will need to adjust the $levels parameter.
196
- $filePtr = $phpcsFile->findNext(\T_FILE, $pathParam['start'], ($pathParam['end'] + 1));
197
- $levelsPtr = $phpcsFile->findNext(\T_LNUMBER, $levelsParam['start'], ($levelsParam['end'] + 1));
198
-
199
- $phpcsFile->fixer->beginChangeset();
200
- $phpcsFile->fixer->replaceToken($filePtr, '__DIR__');
201
- $phpcsFile->fixer->replaceToken($levelsPtr, ($levelsValue - 1));
202
- $phpcsFile->fixer->endChangeset();
203
- }
204
- }
205
-
206
- return;
207
- }
208
-
209
- /*
210
- * PHP 7.0+: Detect use of nested calls to dirname().
211
- */
212
- if ($this->phpVersion !== 0 && $this->phpVersion < 70000) {
213
- // No need to check for this issue if the PHP version would not allow for it anyway.
214
- return;
215
- }
216
-
217
- if (\preg_match('`^\s*\\\\?dirname\s*\(`i', $pathParam['clean']) !== 1) {
218
- return;
219
- }
220
-
221
- /*
222
- * Check if there is something _behind_ the nested dirname() call within the same parameter.
223
- *
224
- * Note: the findNext() calls are safe and will always match the dirname() function call
225
- * as otherwise the above regex wouldn't have matched.
226
- */
227
- $innerDirnamePtr = $phpcsFile->findNext(\T_STRING, $pathParam['start'], ($pathParam['end'] + 1));
228
- $innerOpener = $phpcsFile->findNext(\T_OPEN_PARENTHESIS, ($innerDirnamePtr + 1), ($pathParam['end'] + 1));
229
- if (isset($tokens[$innerOpener]['parenthesis_closer']) === false) {
230
- // Shouldn't be possible.
231
- return; // @codeCoverageIgnore
232
- }
233
-
234
- $innerCloser = $tokens[$innerOpener]['parenthesis_closer'];
235
- if ($innerCloser !== $pathParam['end']) {
236
- $hasContentAfter = $phpcsFile->findNext(
237
- Tokens::$emptyTokens,
238
- ($innerCloser + 1),
239
- ($pathParam['end'] + 1),
240
- true
241
- );
242
- if ($hasContentAfter !== false) {
243
- // Matched code like: `dirname(dirname($file) . 'something')`. Ignore.
244
- return;
245
- }
246
- }
247
-
248
- /*
249
- * Determine if this is an auto-fixable error.
250
- */
251
-
252
- // Step 1: Are there comments ? If so, not auto-fixable as we don't want to remove comments.
253
- $fixable = true;
254
- $outerLevelsValue = false;
255
- $innerParameters = [];
256
- $innerLevelsParam = false;
257
- $innerLevelsValue = false;
258
-
259
- for ($i = ($opener + 1); $i < $closer; $i++) {
260
- if (isset(Tokens::$commentTokens[$tokens[$i]['code']])) {
261
- $fixable = false;
262
- break;
263
- }
264
-
265
- if ($tokens[$i]['code'] === \T_OPEN_PARENTHESIS
266
- && isset($tokens[$i]['parenthesis_closer'])
267
- ) {
268
- // Skip over everything within the nested dirname() function call.
269
- $i = $tokens[$i]['parenthesis_closer'];
270
- }
271
- }
272
-
273
- // Step 2: Does the `$levels` parameter exist for the outer dirname() call and if so, is it usable ?
274
- if ($fixable === true) {
275
- $outerLevelsValue = $this->getLevelsValue($phpcsFile, $levelsParam);
276
- if ($levelsParam !== false && $outerLevelsValue === false) {
277
- // Can't autofix if we don't know the value of the $levels parameter.
278
- $fixable = false;
279
- }
280
- }
281
-
282
- // Step 3: Does the `$levels` parameter exist for the inner dirname() call and if so, is it usable ?
283
- if ($fixable === true) {
284
- $innerParameters = PassedParameters::getParameters($phpcsFile, $innerDirnamePtr);
285
- $innerLevelsParam = PassedParameters::getParameterFromStack($innerParameters, 2, 'levels');
286
- $innerLevelsValue = $this->getLevelsValue($phpcsFile, $innerLevelsParam);
287
- if ($innerLevelsParam !== false && $innerLevelsValue === false) {
288
- // Can't autofix if we don't know the value of the $levels parameter.
289
- $fixable = false;
290
- }
291
- }
292
-
293
- /*
294
- * Throw the error.
295
- */
296
- $error = 'Pass the $levels parameter to the dirname() call instead of using nested dirname() calls';
297
- $error .= ' (PHP >= 7.0)';
298
- $code = 'Nested';
299
-
300
- if ($fixable === false) {
301
- $phpcsFile->addError($error, $stackPtr, $code);
302
- return;
303
- }
304
-
305
- $fix = $phpcsFile->addFixableError($error, $stackPtr, $code);
306
- if ($fix === false) {
307
- return;
308
- }
309
-
310
- /*
311
- * Fix the error.
312
- */
313
- $phpcsFile->fixer->beginChangeset();
314
-
315
- // Remove the info in the _outer_ param call.
316
- for ($i = $opener; $i < $innerOpener; $i++) {
317
- $phpcsFile->fixer->replaceToken($i, '');
318
- }
319
-
320
- for ($i = ($innerCloser + 1); $i <= $closer; $i++) {
321
- $phpcsFile->fixer->replaceToken($i, '');
322
- }
323
-
324
- if ($innerLevelsParam !== false) {
325
- // Inner $levels parameter already exists, just adjust the value.
326
- $innerLevelsPtr = $phpcsFile->findNext(
327
- \T_LNUMBER,
328
- $innerLevelsParam['start'],
329
- ($innerLevelsParam['end'] + 1)
330
- );
331
- $phpcsFile->fixer->replaceToken($innerLevelsPtr, ($innerLevelsValue + $outerLevelsValue));
332
- } else {
333
- // Inner $levels parameter does not exist yet. We need to add it.
334
- $content = ', ';
335
-
336
- $prevBeforeCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($innerCloser - 1), null, true);
337
- if ($tokens[$prevBeforeCloser]['code'] === \T_COMMA) {
338
- // Trailing comma found, no need to add the comma.
339
- $content = ' ';
340
- }
341
-
342
- $innerPathParam = PassedParameters::getParameterFromStack($innerParameters, 1, 'path');
343
- if (isset($innerPathParam['name_token']) === true) {
344
- // Non-named param cannot follow named param, so add param name.
345
- $content .= 'levels: ';
346
- }
347
-
348
- $content .= ($innerLevelsValue + $outerLevelsValue);
349
- $phpcsFile->fixer->addContentBefore($innerCloser, $content);
350
- }
351
-
352
- $phpcsFile->fixer->endChangeset();
353
- }
354
-
355
- /**
356
- * Determine the value of the $levels parameter passed to dirname().
357
- *
358
- * @since 1.0.0
359
- *
360
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
361
- * @param array<string, int|string>|false $levelsParam The information about the parameter as retrieved
362
- * via PassedParameters::getParameterFromStack().
363
- *
364
- * @return int|false Integer levels value or FALSE if the levels value couldn't be determined.
365
- */
366
- private function getLevelsValue($phpcsFile, $levelsParam)
367
- {
368
- if ($levelsParam === false) {
369
- return 1;
370
- }
371
-
372
- $ignore = Tokens::$emptyTokens;
373
- $ignore[] = \T_LNUMBER;
374
-
375
- $hasNonNumber = $phpcsFile->findNext($ignore, $levelsParam['start'], ($levelsParam['end'] + 1), true);
376
- if ($hasNonNumber !== false) {
377
- return false;
378
- }
379
-
380
- return (int) $levelsParam['clean'];
381
- }
382
- }
@@ -1,5 +0,0 @@
1
- <?xml version="1.0"?>
2
- <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Modernize" namespace="PHPCSExtra\Modernize" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
3
-
4
- <description>A collection of sniffs to detect code modernization opportunities.</description>
5
- </ruleset>
@@ -1,94 +0,0 @@
1
- <?xml version="1.0"?>
2
- <documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
- xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
4
- title="Array Brace Spacing"
5
- >
6
- <standard>
7
- <![CDATA[
8
- There should be no space between the "array" keyword and the array open brace.
9
- ]]>
10
- </standard>
11
- <code_comparison>
12
- <code title="Valid: No space between the keyword and the open brace.">
13
- <![CDATA[
14
- $args = array(1, 2);
15
- ]]>
16
- </code>
17
- <code title="Invalid: Space between the keyword and the open brace.">
18
- <![CDATA[
19
- $args = array<em> </em>(1, 2);
20
- ]]>
21
- </code>
22
- </code_comparison>
23
- <standard>
24
- <![CDATA[
25
- There should be no space between the array open brace and the array close brace for an empty array.
26
- ]]>
27
- </standard>
28
- <code_comparison>
29
- <code title="Valid: No space between the braces.">
30
- <![CDATA[
31
- $args = array();
32
-
33
- $args = [];
34
- ]]>
35
- </code>
36
- <code title="Invalid: Space between the braces.">
37
- <![CDATA[
38
- $args = array(<em> </em>);
39
-
40
- $args = [<em> </em>];
41
- ]]>
42
- </code>
43
- </code_comparison>
44
- <standard>
45
- <![CDATA[
46
- There should be no space after the array open brace and before the array close brace in a single-line array.
47
- ]]>
48
- </standard>
49
- <code_comparison>
50
- <code title="Valid: No space on the inside of the braces.">
51
- <![CDATA[
52
- $args = array(1, 2);
53
-
54
- $args = [1, 2];
55
- ]]>
56
- </code>
57
- <code title="Invalid: Space on the inside of the braces.">
58
- <![CDATA[
59
- $args = array(<em> </em>1, 2<em> </em>);
60
-
61
- $args = [<em> </em>1, 2<em> </em>];
62
- ]]>
63
- </code>
64
- </code_comparison>
65
- <standard>
66
- <![CDATA[
67
- There should be a new line after the array open brace and before the array close brace in a multi-line array.
68
- ]]>
69
- </standard>
70
- <code_comparison>
71
- <code title="Valid: One new line after the open brace and before the close brace.">
72
- <![CDATA[
73
- $args = array(<em>
74
- </em> 1,
75
- 2<em>
76
- </em>);
77
-
78
- $args = [<em>
79
- </em> 1,
80
- 2<em>
81
- </em>];
82
- ]]>
83
- </code>
84
- <code title="Invalid: No new lines after the open brace and/or before the close brace.">
85
- <![CDATA[
86
- $args = array(1,
87
- 2);
88
-
89
- $args = [1,
90
- 2];
91
- ]]>
92
- </code>
93
- </code_comparison>
94
- </documentation>