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,55 +0,0 @@
1
- <?php
2
- /**
3
- * PHPCSUtils, utility functions and classes for PHP_CodeSniffer sniff developers.
4
- *
5
- * @package PHPCSUtils
6
- * @copyright 2019-2020 PHPCSUtils Contributors
7
- * @license https://opensource.org/licenses/LGPL-3.0 LGPL3
8
- * @link https://github.com/PHPCSStandards/PHPCSUtils
9
- */
10
-
11
- namespace PHPCSUtils\Tokens;
12
-
13
- /**
14
- * Helpers for working with tokens.
15
- *
16
- * @since 1.0.0
17
- */
18
- final class TokenHelper
19
- {
20
-
21
- /**
22
- * Check whether a PHP native token exists (for real).
23
- *
24
- * Under normal circumstances, checking whether a token exists (either defined by PHP or by PHPCS)
25
- * is as straight-forward as running `defined('T_TOKEN_NAME')`.
26
- *
27
- * Unfortunately, this doesn't work in all circumstances, most notably, if an external standard
28
- * also uses PHP-Parser or when code coverage is run on a standard using PHPUnit >= 9.3 (which uses PHP-Parser),
29
- * this logic breaks because PHP-Parser also polyfills tokens.
30
- * This method takes potentially polyfilled tokens from PHP-Parser into account and will regard the token
31
- * as undefined if it was declared by PHP-Parser.
32
- *
33
- * Note: this method only _needs_ to be used for PHP native tokens, not for PHPCS specific tokens.
34
- * Also, realistically, it only needs to be used for tokens introduced in PHP in recent versions (PHP 7.4 and up).
35
- * Having said that, the method _will_ also work correctly when a name of a PHPCS native token is passed or
36
- * of an older PHP native token.
37
- *
38
- * {@internal PHP native tokens have a positive integer value. PHPCS polyfilled tokens are strings.
39
- * PHP-Parser polyfilled tokens will always have a negative integer value < 0, which is how
40
- * these are filtered out.}
41
- *
42
- * @link https://github.com/sebastianbergmann/php-code-coverage/issues/798 PHP-Code-Coverage#798
43
- * @link https://github.com/nikic/PHP-Parser/blob/master/lib/PhpParser/Lexer.php PHP-Parser Lexer code
44
- *
45
- * @since 1.0.0
46
- *
47
- * @param string $name The token name.
48
- *
49
- * @return bool
50
- */
51
- public static function tokenExists($name)
52
- {
53
- return (\defined($name) && (\is_int(\constant($name)) === false || \constant($name) > 0));
54
- }
55
- }
@@ -1,227 +0,0 @@
1
- <?php
2
- /**
3
- * PHPCSUtils, utility functions and classes for PHP_CodeSniffer sniff developers.
4
- *
5
- * @package PHPCSUtils
6
- * @copyright 2019-2020 PHPCSUtils Contributors
7
- * @license https://opensource.org/licenses/LGPL-3.0 LGPL3
8
- * @link https://github.com/PHPCSStandards/PHPCSUtils
9
- */
10
-
11
- namespace PHPCSUtils\Utils;
12
-
13
- use PHP_CodeSniffer\Exceptions\RuntimeException;
14
- use PHP_CodeSniffer\Files\File;
15
- use PHPCSUtils\Internal\Cache;
16
- use PHPCSUtils\Internal\IsShortArrayOrListWithCache;
17
- use PHPCSUtils\Tokens\Collections;
18
-
19
- /**
20
- * Utility functions for use when examining arrays.
21
- *
22
- * @since 1.0.0
23
- */
24
- final class Arrays
25
- {
26
-
27
- /**
28
- * The tokens to target to find the double arrow in an array item.
29
- *
30
- * @since 1.0.0
31
- *
32
- * @var array<int|string, int|string>
33
- */
34
- private static $doubleArrowTargets = [
35
- \T_DOUBLE_ARROW => \T_DOUBLE_ARROW,
36
-
37
- // Nested arrays.
38
- \T_ARRAY => \T_ARRAY,
39
- \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY,
40
-
41
- // Inline function, control structures and other things to skip over.
42
- \T_LIST => \T_LIST,
43
- \T_FN => \T_FN,
44
- \T_MATCH => \T_MATCH,
45
- \T_ATTRIBUTE => \T_ATTRIBUTE,
46
- ];
47
-
48
- /**
49
- * Determine whether a T_OPEN/CLOSE_SHORT_ARRAY token is a short array construct
50
- * and not a short list.
51
- *
52
- * This method also accepts `T_OPEN/CLOSE_SQUARE_BRACKET` tokens to allow it to be
53
- * PHPCS cross-version compatible as the short array tokenizing has been plagued by
54
- * a number of bugs over time.
55
- *
56
- * @since 1.0.0
57
- *
58
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
59
- * @param int $stackPtr The position of the short array bracket token.
60
- *
61
- * @return bool `TRUE` if the token passed is the open/close bracket of a short array.
62
- * `FALSE` if the token is a short list bracket, a plain square bracket
63
- * or not one of the accepted tokens.
64
- */
65
- public static function isShortArray(File $phpcsFile, $stackPtr)
66
- {
67
- return IsShortArrayOrListWithCache::isShortArray($phpcsFile, $stackPtr);
68
- }
69
-
70
- /**
71
- * Find the array opener and closer based on a T_ARRAY or T_OPEN_SHORT_ARRAY token.
72
- *
73
- * This method also accepts `T_OPEN_SQUARE_BRACKET` tokens to allow it to be
74
- * PHPCS cross-version compatible as the short array tokenizing has been plagued by
75
- * a number of bugs over time, which affects the short array determination.
76
- *
77
- * @since 1.0.0
78
- *
79
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
80
- * @param int $stackPtr The position of the `T_ARRAY` or `T_OPEN_SHORT_ARRAY`
81
- * token in the stack.
82
- * @param true|null $isShortArray Short-circuit the short array check for `T_OPEN_SHORT_ARRAY`
83
- * tokens if it isn't necessary.
84
- * Efficiency tweak for when this has already been established,
85
- * i.e. when encountering a nested array while walking the
86
- * tokens in an array.
87
- * Use with care.
88
- *
89
- * @return array<string, int>|false An array with the token pointers; or `FALSE` if this is not a
90
- * (short) array token or if the opener/closer could not be determined.
91
- * The format of the array return value is:
92
- * ```php
93
- * array(
94
- * 'opener' => integer, // Stack pointer to the array open bracket.
95
- * 'closer' => integer, // Stack pointer to the array close bracket.
96
- * )
97
- * ```
98
- */
99
- public static function getOpenClose(File $phpcsFile, $stackPtr, $isShortArray = null)
100
- {
101
- $tokens = $phpcsFile->getTokens();
102
-
103
- // Is this one of the tokens this function handles ?
104
- if (isset($tokens[$stackPtr]) === false
105
- || isset(Collections::arrayOpenTokensBC()[$tokens[$stackPtr]['code']]) === false
106
- ) {
107
- return false;
108
- }
109
-
110
- switch ($tokens[$stackPtr]['code']) {
111
- case \T_ARRAY:
112
- if (isset($tokens[$stackPtr]['parenthesis_opener'])) {
113
- $opener = $tokens[$stackPtr]['parenthesis_opener'];
114
-
115
- if (isset($tokens[$opener]['parenthesis_closer'])) {
116
- $closer = $tokens[$opener]['parenthesis_closer'];
117
- }
118
- }
119
- break;
120
-
121
- case \T_OPEN_SHORT_ARRAY:
122
- case \T_OPEN_SQUARE_BRACKET:
123
- if ($isShortArray === true || self::isShortArray($phpcsFile, $stackPtr) === true) {
124
- $opener = $stackPtr;
125
- $closer = $tokens[$stackPtr]['bracket_closer'];
126
- }
127
- break;
128
- }
129
-
130
- if (isset($opener, $closer)) {
131
- return [
132
- 'opener' => $opener,
133
- 'closer' => $closer,
134
- ];
135
- }
136
-
137
- return false;
138
- }
139
-
140
- /**
141
- * Get the stack pointer position of the double arrow within an array item.
142
- *
143
- * Expects to be passed the array item start and end tokens as retrieved via
144
- * {@see \PHPCSUtils\Utils\PassedParameters::getParameters()}.
145
- *
146
- * @since 1.0.0
147
- *
148
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being examined.
149
- * @param int $start Stack pointer to the start of the array item.
150
- * @param int $end Stack pointer to the last token in the array item.
151
- *
152
- * @return int|false Stack pointer to the double arrow if this array item has a key; or `FALSE` otherwise.
153
- *
154
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the start or end positions are invalid.
155
- */
156
- public static function getDoubleArrowPtr(File $phpcsFile, $start, $end)
157
- {
158
- $tokens = $phpcsFile->getTokens();
159
-
160
- if (isset($tokens[$start], $tokens[$end]) === false || $start > $end) {
161
- throw new RuntimeException(
162
- 'Invalid start and/or end position passed to getDoubleArrowPtr().'
163
- . ' Received: $start ' . $start . ', $end ' . $end
164
- );
165
- }
166
-
167
- $cacheId = "$start-$end";
168
- if (Cache::isCached($phpcsFile, __METHOD__, $cacheId) === true) {
169
- return Cache::get($phpcsFile, __METHOD__, $cacheId);
170
- }
171
-
172
- $targets = self::$doubleArrowTargets;
173
- $targets += Collections::closedScopes();
174
-
175
- $doubleArrow = ($start - 1);
176
- $returnValue = false;
177
- ++$end;
178
- do {
179
- $doubleArrow = $phpcsFile->findNext(
180
- $targets,
181
- ($doubleArrow + 1),
182
- $end
183
- );
184
-
185
- if ($doubleArrow === false) {
186
- break;
187
- }
188
-
189
- if ($tokens[$doubleArrow]['code'] === \T_DOUBLE_ARROW) {
190
- $returnValue = $doubleArrow;
191
- break;
192
- }
193
-
194
- // Skip over closed scopes which may contain foreach structures or generators.
195
- if ((isset(Collections::closedScopes()[$tokens[$doubleArrow]['code']]) === true
196
- || $tokens[$doubleArrow]['code'] === \T_FN
197
- || $tokens[$doubleArrow]['code'] === \T_MATCH)
198
- && isset($tokens[$doubleArrow]['scope_closer']) === true
199
- ) {
200
- $doubleArrow = $tokens[$doubleArrow]['scope_closer'];
201
- continue;
202
- }
203
-
204
- // Skip over attributes which may contain arrays as a passed parameters.
205
- if ($tokens[$doubleArrow]['code'] === \T_ATTRIBUTE
206
- && isset($tokens[$doubleArrow]['attribute_closer'])
207
- ) {
208
- $doubleArrow = $tokens[$doubleArrow]['attribute_closer'];
209
- continue;
210
- }
211
-
212
- // Skip over potentially keyed long lists.
213
- if ($tokens[$doubleArrow]['code'] === \T_LIST
214
- && isset($tokens[$doubleArrow]['parenthesis_closer'])
215
- ) {
216
- $doubleArrow = $tokens[$doubleArrow]['parenthesis_closer'];
217
- continue;
218
- }
219
-
220
- // Start of nested long/short array.
221
- break;
222
- } while ($doubleArrow < $end);
223
-
224
- Cache::set($phpcsFile, __METHOD__, $cacheId, $returnValue);
225
- return $returnValue;
226
- }
227
- }
@@ -1,156 +0,0 @@
1
- <?php
2
- /**
3
- * PHPCSUtils, utility functions and classes for PHP_CodeSniffer sniff developers.
4
- *
5
- * @package PHPCSUtils
6
- * @copyright 2019-2020 PHPCSUtils Contributors
7
- * @license https://opensource.org/licenses/LGPL-3.0 LGPL3
8
- * @link https://github.com/PHPCSStandards/PHPCSUtils
9
- */
10
-
11
- namespace PHPCSUtils\Utils;
12
-
13
- use PHP_CodeSniffer\Files\File;
14
-
15
- /**
16
- * Utility functions for use when examining token conditions.
17
- *
18
- * @since 1.0.0 The `Conditions::getCondition()` and `Conditions::hasCondition()`
19
- * methods are based on and inspired by the methods of the same name in the
20
- * PHPCS native `PHP_CodeSniffer\Files\File` class.
21
- * Also see {@see \PHPCSUtils\BackCompat\BCFile}.
22
- */
23
- final class Conditions
24
- {
25
-
26
- /**
27
- * Retrieve the position of a condition for the passed token.
28
- *
29
- * If no types are specified, the first condition for the token - or if `$first=false`,
30
- * the last condition - will be returned.
31
- *
32
- * Main differences with the PHPCS version:
33
- * - The singular `$type` parameter has become the more flexible `$types` parameter allowing to
34
- * search for several types of conditions in one go.
35
- * - The `$types` parameter is now optional.
36
- *
37
- * @see \PHP_CodeSniffer\Files\File::getCondition() Original source.
38
- * @see \PHPCSUtils\BackCompat\BCFile::getCondition() Cross-version compatible version of the original.
39
- *
40
- * @since 1.0.0
41
- *
42
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
43
- * @param int $stackPtr The position of the token we are checking.
44
- * @param int|string|array<int|string> $types Optional. The type(s) of tokens to search for.
45
- * @param bool $first Optional. Whether to search for the first (outermost)
46
- * (`true`) or the last (innermost) condition (`false`) of
47
- * the specified type(s).
48
- *
49
- * @return int|false Integer stack pointer to the condition; or `FALSE` if the token
50
- * does not have the condition or has no conditions at all.
51
- */
52
- public static function getCondition(File $phpcsFile, $stackPtr, $types = [], $first = true)
53
- {
54
- $tokens = $phpcsFile->getTokens();
55
-
56
- // Check for the existence of the token.
57
- if (isset($tokens[$stackPtr]) === false) {
58
- return false;
59
- }
60
-
61
- // Make sure the token has conditions.
62
- if (empty($tokens[$stackPtr]['conditions'])) {
63
- return false;
64
- }
65
-
66
- $types = (array) $types;
67
- $conditions = $tokens[$stackPtr]['conditions'];
68
-
69
- if (empty($types) === true) {
70
- // No types specified, just return the first/last condition pointer.
71
- if ($first === false) {
72
- \end($conditions);
73
- } else {
74
- \reset($conditions);
75
- }
76
-
77
- return \key($conditions);
78
- }
79
-
80
- if ($first === false) {
81
- $conditions = \array_reverse($conditions, true);
82
- }
83
-
84
- foreach ($conditions as $ptr => $type) {
85
- if (isset($tokens[$ptr]) === true
86
- && \in_array($type, $types, true) === true
87
- ) {
88
- // We found a token with the required type.
89
- return $ptr;
90
- }
91
- }
92
-
93
- return false;
94
- }
95
-
96
- /**
97
- * Determine if the passed token has a condition of one of the passed types.
98
- *
99
- * This method is not significantly different from the PHPCS native version.
100
- *
101
- * @see \PHP_CodeSniffer\Files\File::hasCondition() Original source.
102
- * @see \PHPCSUtils\BackCompat\BCFile::hasCondition() Cross-version compatible version of the original.
103
- *
104
- * @since 1.0.0
105
- *
106
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
107
- * @param int $stackPtr The position of the token we are checking.
108
- * @param int|string|array<int|string> $types The type(s) of tokens to search for.
109
- *
110
- * @return bool
111
- */
112
- public static function hasCondition(File $phpcsFile, $stackPtr, $types)
113
- {
114
- return (self::getCondition($phpcsFile, $stackPtr, $types) !== false);
115
- }
116
-
117
- /**
118
- * Return the position of the first (outermost) condition of a certain type for the passed token.
119
- *
120
- * If no types are specified, the first condition for the token, independently of type,
121
- * will be returned.
122
- *
123
- * @since 1.0.0
124
- *
125
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found.
126
- * @param int $stackPtr The position of the token we are checking.
127
- * @param int|string|array<int|string> $types Optional. The type(s) of tokens to search for.
128
- *
129
- * @return int|false Integer stack pointer to the condition; or `FALSE` if the token
130
- * does not have the condition or has no conditions at all.
131
- */
132
- public static function getFirstCondition(File $phpcsFile, $stackPtr, $types = [])
133
- {
134
- return self::getCondition($phpcsFile, $stackPtr, $types, true);
135
- }
136
-
137
- /**
138
- * Return the position of the last (innermost) condition of a certain type for the passed token.
139
- *
140
- * If no types are specified, the last condition for the token, independently of type,
141
- * will be returned.
142
- *
143
- * @since 1.0.0
144
- *
145
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found.
146
- * @param int $stackPtr The position of the token we are checking.
147
- * @param int|string|array<int|string> $types Optional. The type(s) of tokens to search for.
148
- *
149
- * @return int|false Integer stack pointer to the condition; or `FALSE` if the token
150
- * does not have the condition or has no conditions at all.
151
- */
152
- public static function getLastCondition(File $phpcsFile, $stackPtr, $types = [])
153
- {
154
- return self::getCondition($phpcsFile, $stackPtr, $types, false);
155
- }
156
- }
@@ -1,232 +0,0 @@
1
- <?php
2
- /**
3
- * PHPCSUtils, utility functions and classes for PHP_CodeSniffer sniff developers.
4
- *
5
- * @package PHPCSUtils
6
- * @copyright 2019-2020 PHPCSUtils Contributors
7
- * @license https://opensource.org/licenses/LGPL-3.0 LGPL3
8
- * @link https://github.com/PHPCSStandards/PHPCSUtils
9
- */
10
-
11
- namespace PHPCSUtils\Utils;
12
-
13
- use PHP_CodeSniffer\Files\File;
14
- use PHPCSUtils\Utils\Parentheses;
15
-
16
- /**
17
- * Utility functions for examining in which context a certain token is used.
18
- *
19
- * Example use-cases:
20
- * - A sniff looking for the use of certain variables may want to disregard the "use"
21
- * of these variables within a call to `isset()` or `empty()`.
22
- * - A sniff looking for incrementor/decrementors may want to disregard these when used
23
- * as the third expression in a `for()` condition.
24
- *
25
- * @since 1.0.0
26
- */
27
- final class Context
28
- {
29
-
30
- /**
31
- * Check whether an arbitrary token is within a call to empty().
32
- *
33
- * _This method is a thin, descriptive wrapper around the {@see Parentheses::getLastOwner()} method.
34
- * For more complex/combined queries, it is recommended to call the {@see Parentheses::getLastOwner()}
35
- * method directly._
36
- *
37
- * @since 1.0.0
38
- *
39
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
40
- * @param int $stackPtr The position of the token we are checking.
41
- *
42
- * @return bool
43
- */
44
- public static function inEmpty(File $phpcsFile, $stackPtr)
45
- {
46
- return (Parentheses::getLastOwner($phpcsFile, $stackPtr, \T_EMPTY) !== false);
47
- }
48
-
49
- /**
50
- * Check whether an arbitrary token is within a call to isset().
51
- *
52
- * _This method is a thin, descriptive wrapper around the {@see Parentheses::getLastOwner()} method.
53
- * For more complex/combined queries, it is recommended to call the {@see Parentheses::getLastOwner()}
54
- * method directly._
55
- *
56
- * @since 1.0.0
57
- *
58
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
59
- * @param int $stackPtr The position of the token we are checking.
60
- *
61
- * @return bool
62
- */
63
- public static function inIsset(File $phpcsFile, $stackPtr)
64
- {
65
- return (Parentheses::getLastOwner($phpcsFile, $stackPtr, \T_ISSET) !== false);
66
- }
67
-
68
- /**
69
- * Check whether an arbitrary token is within a call to unset().
70
- *
71
- * _This method is a thin, descriptive wrapper around the {@see Parentheses::getLastOwner()} method.
72
- * For more complex/combined queries, it is recommended to call the {@see Parentheses::getLastOwner()}
73
- * method directly._
74
- *
75
- * @since 1.0.0
76
- *
77
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
78
- * @param int $stackPtr The position of the token we are checking.
79
- *
80
- * @return bool
81
- */
82
- public static function inUnset(File $phpcsFile, $stackPtr)
83
- {
84
- return (Parentheses::getLastOwner($phpcsFile, $stackPtr, \T_UNSET) !== false);
85
- }
86
-
87
- /**
88
- * Check whether an arbitrary token is within an attribute.
89
- *
90
- * @since 1.0.0
91
- *
92
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
93
- * @param int $stackPtr The position of the token we are checking.
94
- *
95
- * @return bool
96
- */
97
- public static function inAttribute(File $phpcsFile, $stackPtr)
98
- {
99
- $tokens = $phpcsFile->getTokens();
100
-
101
- // Check for the existence of the token.
102
- if (isset($tokens[$stackPtr]) === false) {
103
- return false;
104
- }
105
-
106
- if (isset($tokens[$stackPtr]['attribute_opener'], $tokens[$stackPtr]['attribute_closer']) === false) {
107
- return false;
108
- }
109
-
110
- return ($stackPtr !== $tokens[$stackPtr]['attribute_opener']
111
- && $stackPtr !== $tokens[$stackPtr]['attribute_closer']);
112
- }
113
-
114
- /**
115
- * Check whether an arbitrary token is in a foreach condition and if so, in which part:
116
- * before or after the "as".
117
- *
118
- * @since 1.0.0
119
- *
120
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
121
- * @param int $stackPtr The position of the token we are checking.
122
- *
123
- * @return string|false String `'beforeAs'`, `'as'` or `'afterAs'` when the token is within
124
- * a `foreach` condition.
125
- * `FALSE` in all other cases, including for parse errors.
126
- */
127
- public static function inForeachCondition(File $phpcsFile, $stackPtr)
128
- {
129
- $tokens = $phpcsFile->getTokens();
130
-
131
- // Check for the existence of the token.
132
- if (isset($tokens[$stackPtr]) === false) {
133
- return false;
134
- }
135
-
136
- $foreach = Parentheses::getLastOwner($phpcsFile, $stackPtr, \T_FOREACH);
137
- if ($foreach === false) {
138
- return false;
139
- }
140
-
141
- if ($tokens[$stackPtr]['code'] === \T_AS) {
142
- return 'as';
143
- }
144
-
145
- $asPtr = $phpcsFile->findNext(
146
- \T_AS,
147
- ($tokens[$foreach]['parenthesis_opener'] + 1),
148
- $tokens[$foreach]['parenthesis_closer']
149
- );
150
-
151
- if ($asPtr === false) {
152
- // Parse error or live coding.
153
- return false;
154
- }
155
-
156
- if ($stackPtr < $asPtr) {
157
- return 'beforeAs';
158
- }
159
-
160
- return 'afterAs';
161
- }
162
-
163
- /**
164
- * Check whether an arbitrary token is in a for condition and if so, in which part:
165
- * the first, second or third expression.
166
- *
167
- * Note: the semicolons separating the conditions are regarded as belonging with the
168
- * expression before it.
169
- *
170
- * @since 1.0.0
171
- *
172
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
173
- * @param int $stackPtr The position of the token we are checking.
174
- *
175
- * @return string|false String `'expr1'`, `'expr2'` or `'expr3'` when the token is within
176
- * a `for` condition.
177
- * `FALSE` in all other cases, including for parse errors.
178
- */
179
- public static function inForCondition(File $phpcsFile, $stackPtr)
180
- {
181
- $tokens = $phpcsFile->getTokens();
182
-
183
- // Check for the existence of the token.
184
- if (isset($tokens[$stackPtr]) === false) {
185
- return false;
186
- }
187
-
188
- $for = Parentheses::getLastOwner($phpcsFile, $stackPtr, \T_FOR);
189
- if ($for === false) {
190
- return false;
191
- }
192
-
193
- $semicolons = [];
194
- $count = 0;
195
- $opener = $tokens[$for]['parenthesis_opener'];
196
- $closer = $tokens[$for]['parenthesis_closer'];
197
- $level = $tokens[$for]['level'];
198
- $parens = 1;
199
-
200
- if (isset($tokens[$for]['nested_parenthesis'])) {
201
- $parens = (\count($tokens[$for]['nested_parenthesis']) + 1);
202
- }
203
-
204
- for ($i = ($opener + 1); $i < $closer; $i++) {
205
- if ($tokens[$i]['code'] !== \T_SEMICOLON) {
206
- continue;
207
- }
208
-
209
- if ($tokens[$i]['level'] !== $level
210
- || \count($tokens[$i]['nested_parenthesis']) !== $parens
211
- ) {
212
- // Disregard semicolons at lower nesting/condition levels.
213
- continue;
214
- }
215
-
216
- ++$count;
217
- $semicolons[$count] = $i;
218
- }
219
-
220
- if ($count !== 2) {
221
- return false;
222
- }
223
-
224
- foreach ($semicolons as $key => $ptr) {
225
- if ($stackPtr <= $ptr) {
226
- return 'expr' . $key;
227
- }
228
- }
229
-
230
- return 'expr3';
231
- }
232
- }