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,333 +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 PHP_CodeSniffer\Util\Tokens;
16
- use PHPCSUtils\Internal\Cache;
17
- use PHPCSUtils\Tokens\Collections;
18
- use PHPCSUtils\Utils\Scopes;
19
- use PHPCSUtils\Utils\TextStrings;
20
-
21
- /**
22
- * Utility functions for use when examining variables.
23
- *
24
- * @since 1.0.0 The `Variables::getMemberProperties()` method is based on and inspired by
25
- * the method of the same name in the PHPCS native `PHP_CodeSniffer\Files\File` class.
26
- * Also see {@see \PHPCSUtils\BackCompat\BCFile}.
27
- */
28
- final class Variables
29
- {
30
-
31
- /**
32
- * List of PHP Reserved variables.
33
- *
34
- * The array keys are the variable names without the leading dollar sign, the values indicate
35
- * whether the variable is a superglobal or not.
36
- *
37
- * The variables names are set without the leading dollar sign to allow this array
38
- * to be used with array index keys as well. Think: `'_GET'` in `$GLOBALS['_GET']`.}
39
- *
40
- * @link https://php.net/reserved.variables PHP Manual on reserved variables
41
- *
42
- * @since 1.0.0
43
- *
44
- * @var array<string, bool>
45
- */
46
- public static $phpReservedVars = [
47
- '_SERVER' => true,
48
- '_GET' => true,
49
- '_POST' => true,
50
- '_REQUEST' => true,
51
- '_SESSION' => true,
52
- '_ENV' => true,
53
- '_COOKIE' => true,
54
- '_FILES' => true,
55
- 'GLOBALS' => true,
56
- 'http_response_header' => false,
57
- 'argc' => false,
58
- 'argv' => false,
59
-
60
- // Deprecated.
61
- 'php_errormsg' => false,
62
-
63
- // Removed PHP 5.4.0.
64
- 'HTTP_SERVER_VARS' => false,
65
- 'HTTP_GET_VARS' => false,
66
- 'HTTP_POST_VARS' => false,
67
- 'HTTP_SESSION_VARS' => false,
68
- 'HTTP_ENV_VARS' => false,
69
- 'HTTP_COOKIE_VARS' => false,
70
- 'HTTP_POST_FILES' => false,
71
-
72
- // Removed PHP 5.6.0.
73
- 'HTTP_RAW_POST_DATA' => false,
74
- ];
75
-
76
- /**
77
- * Retrieve the visibility and implementation properties of a class member variable.
78
- *
79
- * Main differences with the PHPCS version:
80
- * - Removed the parse error warning for properties in interfaces.
81
- * This will now throw the same _"$stackPtr is not a class member var"_ runtime exception as
82
- * other non-property variables passed to the method.
83
- * - Defensive coding against incorrect calls to this method.
84
- * - Support PHP 8.0 identifier name tokens in property types, cross-version PHP & PHPCS.
85
- * - The results of this function call are cached during a PHPCS run for faster response times.
86
- *
87
- * @see \PHP_CodeSniffer\Files\File::getMemberProperties() Original source.
88
- * @see \PHPCSUtils\BackCompat\BCFile::getMemberProperties() Cross-version compatible version of the original.
89
- *
90
- * @since 1.0.0
91
- *
92
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
93
- * @param int $stackPtr The position in the stack of the `T_VARIABLE` token
94
- * to acquire the properties for.
95
- *
96
- * @return array<string, mixed> Array with information about the class member variable.
97
- * The format of the return value is:
98
- * ```php
99
- * array(
100
- * 'scope' => string, // Public, private, or protected.
101
- * 'scope_specified' => boolean, // TRUE if the scope was explicitly specified.
102
- * 'is_static' => boolean, // TRUE if the static keyword was found.
103
- * 'is_readonly' => boolean, // TRUE if the readonly keyword was found.
104
- * 'type' => string, // The type of the var (empty if no type specified).
105
- * 'type_token' => integer|false, // The stack pointer to the start of the type
106
- * // or FALSE if there is no type.
107
- * 'type_end_token' => integer|false, // The stack pointer to the end of the type
108
- * // or FALSE if there is no type.
109
- * 'nullable_type' => boolean, // TRUE if the type is preceded by the
110
- * // nullability operator.
111
- * );
112
- * ```
113
- *
114
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
115
- * `T_VARIABLE` token.
116
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
117
- * class member variable.
118
- */
119
- public static function getMemberProperties(File $phpcsFile, $stackPtr)
120
- {
121
- $tokens = $phpcsFile->getTokens();
122
-
123
- if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_VARIABLE) {
124
- throw new RuntimeException('$stackPtr must be of type T_VARIABLE');
125
- }
126
-
127
- if (Scopes::isOOProperty($phpcsFile, $stackPtr) === false) {
128
- throw new RuntimeException('$stackPtr is not a class member var');
129
- }
130
-
131
- if (Cache::isCached($phpcsFile, __METHOD__, $stackPtr) === true) {
132
- return Cache::get($phpcsFile, __METHOD__, $stackPtr);
133
- }
134
-
135
- $valid = Collections::propertyModifierKeywords() + Tokens::$emptyTokens;
136
-
137
- $scope = 'public';
138
- $scopeSpecified = false;
139
- $isStatic = false;
140
- $isReadonly = false;
141
-
142
- $startOfStatement = $phpcsFile->findPrevious(
143
- [
144
- \T_SEMICOLON,
145
- \T_OPEN_CURLY_BRACKET,
146
- \T_CLOSE_CURLY_BRACKET,
147
- \T_ATTRIBUTE_END,
148
- ],
149
- ($stackPtr - 1)
150
- );
151
-
152
- for ($i = ($startOfStatement + 1); $i < $stackPtr; $i++) {
153
- if (isset($valid[$tokens[$i]['code']]) === false) {
154
- break;
155
- }
156
-
157
- switch ($tokens[$i]['code']) {
158
- case \T_PUBLIC:
159
- $scope = 'public';
160
- $scopeSpecified = true;
161
- break;
162
- case \T_PRIVATE:
163
- $scope = 'private';
164
- $scopeSpecified = true;
165
- break;
166
- case \T_PROTECTED:
167
- $scope = 'protected';
168
- $scopeSpecified = true;
169
- break;
170
- case \T_STATIC:
171
- $isStatic = true;
172
- break;
173
- case \T_READONLY:
174
- $isReadonly = true;
175
- break;
176
- }
177
- }
178
-
179
- $type = '';
180
- $typeToken = false;
181
- $typeEndToken = false;
182
- $nullableType = false;
183
- $propertyTypeTokens = Collections::propertyTypeTokens();
184
-
185
- if ($i < $stackPtr) {
186
- // We've found a type.
187
- for ($i; $i < $stackPtr; $i++) {
188
- if ($tokens[$i]['code'] === \T_VARIABLE) {
189
- // Hit another variable in a group definition.
190
- break;
191
- }
192
-
193
- if ($tokens[$i]['code'] === \T_NULLABLE) {
194
- $nullableType = true;
195
- }
196
-
197
- if (isset($propertyTypeTokens[$tokens[$i]['code']]) === true) {
198
- $typeEndToken = $i;
199
- if ($typeToken === false) {
200
- $typeToken = $i;
201
- }
202
-
203
- $type .= $tokens[$i]['content'];
204
- }
205
- }
206
-
207
- if ($type !== '' && $nullableType === true) {
208
- $type = '?' . $type;
209
- }
210
- }
211
-
212
- $returnValue = [
213
- 'scope' => $scope,
214
- 'scope_specified' => $scopeSpecified,
215
- 'is_static' => $isStatic,
216
- 'is_readonly' => $isReadonly,
217
- 'type' => $type,
218
- 'type_token' => $typeToken,
219
- 'type_end_token' => $typeEndToken,
220
- 'nullable_type' => $nullableType,
221
- ];
222
-
223
- Cache::set($phpcsFile, __METHOD__, $stackPtr, $returnValue);
224
- return $returnValue;
225
- }
226
-
227
- /**
228
- * Verify if a given variable name is the name of a PHP reserved variable.
229
- *
230
- * @see \PHPCSUtils\Utils\Variables::$phpReservedVars List of variables names reserved by PHP.
231
- *
232
- * @since 1.0.0
233
- *
234
- * @param string $name The full variable name with or without leading dollar sign.
235
- * This allows for passing an array key variable name, such as
236
- * `'_GET'` retrieved from `$GLOBALS['_GET']`.
237
- * > Note: when passing an array key, string quotes are expected
238
- * to have been stripped already.
239
- * Also see: {@see \PHPCSUtils\Utils\TextStrings::stripQuotes()}.
240
- *
241
- * @return bool
242
- */
243
- public static function isPHPReservedVarName($name)
244
- {
245
- if (\strpos($name, '$') === 0) {
246
- $name = \substr($name, 1);
247
- }
248
-
249
- return (isset(self::$phpReservedVars[$name]) === true);
250
- }
251
-
252
- /**
253
- * Verify if a given variable or array key token points to a PHP superglobal.
254
- *
255
- * @since 1.0.0
256
- *
257
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found.
258
- * @param int $stackPtr The position in the stack of a `T_VARIABLE`
259
- * token or of the `T_CONSTANT_ENCAPSED_STRING`
260
- * array key to a variable in `$GLOBALS`.
261
- *
262
- * @return bool `TRUE` if this points to a superglobal; `FALSE` when not.
263
- * > Note: This includes returning `FALSE` when an unsupported token has
264
- * been passed, when a `T_CONSTANT_ENCAPSED_STRING` has been passed which
265
- * is not an array index key; or when it is, but is not an index to the
266
- * `$GLOBALS` variable.
267
- */
268
- public static function isSuperglobal(File $phpcsFile, $stackPtr)
269
- {
270
- $tokens = $phpcsFile->getTokens();
271
-
272
- if (isset($tokens[$stackPtr]) === false
273
- || ($tokens[$stackPtr]['code'] !== \T_VARIABLE
274
- && $tokens[$stackPtr]['code'] !== \T_CONSTANT_ENCAPSED_STRING)
275
- ) {
276
- return false;
277
- }
278
-
279
- $content = $tokens[$stackPtr]['content'];
280
-
281
- if ($tokens[$stackPtr]['code'] === \T_CONSTANT_ENCAPSED_STRING) {
282
- $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);
283
- $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
284
- if (($prev === false || $tokens[$prev]['code'] !== \T_OPEN_SQUARE_BRACKET)
285
- || ($next === false || $tokens[$next]['code'] !== \T_CLOSE_SQUARE_BRACKET)
286
- ) {
287
- // Not a single string array index key.
288
- return false;
289
- }
290
-
291
- $pprev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true);
292
- if ($pprev === false
293
- || $tokens[$pprev]['code'] !== \T_VARIABLE
294
- || $tokens[$pprev]['content'] !== '$GLOBALS'
295
- ) {
296
- // Not accessing the `$GLOBALS` array.
297
- return false;
298
- }
299
-
300
- // Strip quotes.
301
- $content = TextStrings::stripQuotes($content);
302
- }
303
-
304
- return self::isSuperglobalName($content);
305
- }
306
-
307
- /**
308
- * Verify if a given variable name is the name of a PHP superglobal.
309
- *
310
- * @since 1.0.0
311
- *
312
- * @param string $name The full variable name with or without leading dollar sign.
313
- * This allows for passing an array key variable name, such as
314
- * `'_GET'` retrieved from `$GLOBALS['_GET']`.
315
- * > Note: when passing an array key, string quotes are expected
316
- * to have been stripped already.
317
- * Also see: {@see \PHPCSUtils\Utils\TextStrings::stripQuotes()}.
318
- *
319
- * @return bool
320
- */
321
- public static function isSuperglobalName($name)
322
- {
323
- if (\strpos($name, '$') === 0) {
324
- $name = \substr($name, 1);
325
- }
326
-
327
- if (isset(self::$phpReservedVars[$name]) === false) {
328
- return false;
329
- }
330
-
331
- return self::$phpReservedVars[$name];
332
- }
333
- }
@@ -1,4 +0,0 @@
1
- <?xml version="1.0"?>
2
- <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHPCSUtils" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
3
- <description>Utility methods for external PHPCS standards.</description>
4
- </ruleset>
@@ -1,297 +0,0 @@
1
- # PHPCSUtils: A suite of utility functions for use with PHP_CodeSniffer
2
-
3
- <div aria-hidden="true">
4
-
5
- [![Latest Stable Version](https://poser.pugx.org/phpcsstandards/phpcsutils/v/stable)][phpcsutils-packagist]
6
- [![Release Date of the Latest Version](https://img.shields.io/github/release-date/PHPCSStandards/PHPCSUtils.svg?maxAge=1800)][phpcsutils-releases]
7
- :construction:
8
- [![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcsstandards/phpcsutils#dev-develop)
9
- [![Last Commit to Unstable](https://img.shields.io/github/last-commit/PHPCSStandards/PHPCSUtils/develop.svg)](https://github.com/PHPCSStandards/PHPCSUtils/commits/develop)
10
-
11
- [![Docs website](https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/update-docs.yml/badge.svg)][phpcsutils-web]
12
- [![CS Build Status](https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/basics.yml/badge.svg?branch=develop)](https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/basics.yml)
13
- [![Test Build Status](https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/test.yml/badge.svg?branch=develop)][phpcsutils-tests-gha]
14
- [![Coverage Status](https://coveralls.io/repos/github/PHPCSStandards/PHPCSUtils/badge.svg?branch=develop)](https://coveralls.io/github/PHPCSStandards/PHPCSUtils?branch=develop)
15
-
16
- [![Minimum PHP Version](https://img.shields.io/packagist/php-v/phpcsstandards/phpcsutils.svg?maxAge=3600)][phpcsutils-packagist]
17
- [![Tested on PHP 5.4 to 8.3](https://img.shields.io/badge/tested%20on-PHP%205.4%20|%205.5%20|%205.6%20|%207.0%20|%207.1%20|%207.2%20|%207.3%20|%207.4%20|%208.0%20|%208.1%20|%208.2%20|%208.3-brightgreen.svg?maxAge=2419200)][phpcsutils-tests-gha]
18
-
19
- [![License: LGPLv3](https://poser.pugx.org/phpcsstandards/phpcsutils/license)](https://github.com/PHPCSStandards/PHPCSUtils/blob/stable/LICENSE)
20
- ![Awesome](https://img.shields.io/badge/awesome%3F-yes!-brightgreen.svg)
21
-
22
- </div>
23
-
24
- * [Features](#features)
25
- * [Minimum Requirements](#minimum-requirements)
26
- * [Integrating PHPCSUtils in your external PHPCS standard](#integrating-phpcsutils-in-your-external-phpcs-standard)
27
- - [Composer-based](#composer-based)
28
- - [Non-Composer based integration](#non-composer-based-integration)
29
- * [Frequently Asked Questions](#frequently-asked-questions)
30
- * [Potential Support Questions from your End-Users](#potential-support-questions-from-your-end-users)
31
- * [Contributing](#contributing)
32
- * [License](#license)
33
-
34
-
35
- ## Features
36
-
37
- [PHPCSUtils][phpcsutils-repo] is a set of utilities to aid developers of sniffs for [PHP_CodeSniffer] (or "PHPCS" for short).
38
-
39
- This package offers the following features:
40
-
41
- <div id="feature-list">
42
-
43
- ### An ever-growing number of utility functions for use with PHP_CodeSniffer
44
-
45
- Whether you need to split an `array` into the individual items, are trying to determine which variables are being assigned to in a `list()` or are figuring out whether a function has a DocBlock, PHPCSUtils has got you covered!
46
-
47
- Includes improved versions of the PHPCS native utility functions and plenty of new utility functions.
48
-
49
- These functions are compatible with PHPCS 3.10.0 up to PHPCS `master`.
50
-
51
- ### A collection of static properties and methods for often-used token groups
52
-
53
- Collections of related tokens often-used and needed for sniffs.
54
- These are additional "token groups" to compliment the ones available through the PHPCS native `PHP_CodeSniffer\Util\Tokens` class.
55
-
56
- ### Several abstract sniff classes which your sniffs can extend
57
-
58
- These classes take most of the heavy lifting away for some frequently occurring sniff types.
59
-
60
- ### Test utilities
61
-
62
- An abstract `UtilityMethodTestCase` class to support testing of your utility methods written for PHP_CodeSniffer.
63
- Supports PHPUnit 4.x up to 9.x.
64
-
65
- ### Use the latest version of PHP_CodeSniffer native utility functions
66
-
67
- Normally to use the latest version of PHP_CodeSniffer native utility functions, you would have to raise the minimum requirements of your external PHPCS standard.
68
-
69
- Now you won't have to anymore. This package allows you to use the latest version of those utility functions in all PHP_CodeSniffer versions from PHPCS 3.10.0 and up.
70
-
71
- ### Fully documented
72
-
73
- To see detailed information about all the available abstract sniffs, utility functions and PHPCS helper functions, have a read through the [extensive documentation][phpcsutils-web].
74
-
75
- </div>
76
-
77
-
78
- ## Minimum Requirements
79
-
80
- * PHP 5.4 or higher.
81
- * [PHP_CodeSniffer] 3.10.0+.
82
- * Recommended PHP extensions for optimal functionality:
83
- - PCRE with Unicode support (normally enabled by default)
84
-
85
-
86
- ## Integrating PHPCSUtils in your external PHPCS standard
87
-
88
- ### Composer-based
89
-
90
- If your external PHP_CodeSniffer standard only supports Composer-based installs, integrating PHPCSUtils is pretty straight forward.
91
-
92
- Run the following from the root of your external PHPCS standard's project:
93
-
94
- ```bash
95
- composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
96
- composer require phpcsstandards/phpcsutils:"^1.0"
97
- ```
98
-
99
- No further action needed. You can start using all the utility functions, abstract sniff classes and other features of PHPCSUtils straight away.
100
-
101
- > :information_source: The PHPCSUtils package includes the [Composer PHPCS plugin].
102
- >
103
- > This plugin will automatically register PHPCSUtils (and your own external standard) with PHP_CodeSniffer, so you and your users don't have to worry about this anymore.
104
- >
105
- > :warning: Note: if your end-user installation instructions include instructions on adding a Composer PHPCS plugin or on manually registering your standard with PHPCS using the `--config-set installed_paths` command, you can remove those instructions as they are no longer needed.
106
- >
107
- > :information_source: As of Composer 2.2, Composer will [ask for permission](https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution) to allow the Composer PHPCS plugin to execute code. For the plugin to be functional, permission needs to be granted.
108
- > This can be done ahead of time by instructing your users to run the following command before installing your standard:
109
- >
110
- > ```bash
111
- > composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
112
- > ```
113
-
114
- #### Running your unit tests
115
-
116
- If your unit tests use the PHP_CodeSniffer native unit test suite, all is good.
117
-
118
- If you have your own unit test suite to test your sniffs, make sure to load the Composer `vendor/autoload.php` file in your PHPUnit bootstrap file or _as_ the PHPUnit bootstrap file.
119
-
120
- If you intend to use the test utilities provided in the `PHPCSUtils/TestUtils` directory, make sure you also load the `vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php` file in your PHPUnit bootstrap file.
121
-
122
-
123
- ### Non-Composer based integration
124
-
125
- In this case, more than anything, you will need to update the non-Composer installation instructions for your end-users.
126
-
127
- To use a non-Composer based installation for your sniff development environment, the same instructions would apply.
128
-
129
- Your installation instructions for a non-Composer based installation will probably look similar to this:
130
-
131
- > * Install [PHP_CodeSniffer] via [your preferred method](https://github.com/PHPCSStandards/PHP_CodeSniffer#installation).
132
- > * Register the path to PHPCS in your system `$PATH` environment variable to make the `phpcs` command available from anywhere in your file system.
133
- > * Download the \[latest _YourStandardName_ release\] and unzip/untar it into an arbitrary directory.
134
- > You can also choose to clone the repository using git.
135
- > * Add the path to the directory in which you placed your copy of the _YourStandardName_ repo to the PHP_CodeSniffer configuration using the below command:
136
- >
137
- > ```bash
138
- > phpcs --config-set installed_paths /path/to/YourStandardName
139
- > ```
140
- >
141
- > **Warning**: :warning: The `installed_paths` command overwrites any previously set `installed_paths`. If you have previously set `installed_paths` for other external standards, run `phpcs --config-show` first and then run the `installed_paths` command with all the paths you need separated by comma's, i.e.:
142
- >
143
- > ```bash
144
- > phpcs --config-set installed_paths /path/1,/path/2,/path/3
145
- > ```
146
-
147
- For things to continue working when you add PHPCSUtils to your standard, you need to replace the last bullet with this:
148
-
149
- > * **Next, download the [latest PHPCSUtils release][phpcsutils-releases] and unzip/untar it into an arbitrary directory.**
150
- > You can also choose to clone the repository using git.
151
- > * Add the path to the **directories** in which you placed your copy of the _YourStandardName_ repo **and the PHPCSUtils repo** to the PHP_CodeSniffer configuration using the below command:
152
- >
153
- > ```bash
154
- > phpcs --config-set installed_paths /path/to/YourStandardName,/path/to/PHPCSUtils
155
- > ```
156
- >
157
- > **Warning**: :warning: The `installed_paths` command overwrites any previously set `installed_paths`. If you have previously set `installed_paths` for other external standards, run `phpcs --config-show` first and then run the `installed_paths` command with all the paths you need separated by comma's, i.e.:
158
- >
159
- > ```bash
160
- > phpcs --config-set installed_paths /path/1,/path/2,/path/3
161
- > ```
162
-
163
- #### Running your unit tests
164
-
165
- To support non-Composer based installs for running your sniff unit tests, you will need to adjust the PHPUnit `bootstrap.php` file to allow for passing an environment variable pointing to your PHPCSUtils installation.
166
-
167
- <details>
168
- <summary><b>Example bootstrap code using a <code>PHPCSUtils_DIR</code> environment variable</b></summary>
169
-
170
- ```php
171
- // Get the PHPCS dir from an environment variable.
172
- $phpcsUtilDir = getenv('PHPCSUtils_DIR');
173
-
174
- // This may be a Composer install.
175
- if ($phpcsUtilDir === false && file_exists(__DIR__ . '/vendor/autoload.php')) {
176
- $vendorDir = __DIR__ . '/vendor';
177
- $phpcsUtilDir = $vendorDir . '/phpcsstandards/phpcsutils';
178
-
179
- // Load the Composer autoload file.
180
- require_once $vendorDir . '/autoload.php';
181
-
182
- // This snippet is only needed when you use the PHPCSUtils TestUtils.
183
- if (file_exists($phpcsUtilDir . '/phpcsutils-autoload.php')) {
184
- require_once $phpcsUtilDir . '/phpcsutils-autoload.php';
185
- }
186
-
187
- } elseif ($phpcsUtilDir !== false) {
188
- $phpcsUtilDir = realpath($phpcsUtilDir);
189
-
190
- require_once $phpcsUtilDir . '/phpcsutils-autoload.php';
191
- } else {
192
- echo 'Uh oh... can\'t find PHPCSUtils.
193
-
194
- If you use Composer, please run `composer install`.
195
- Otherwise, make sure you set a `PHPCSUtils_DIR` environment variable in your phpunit.xml file
196
- pointing to the PHPCS directory.
197
- ';
198
-
199
- die(1);
200
- }
201
- ```
202
-
203
- </details>
204
-
205
- Once that's done, you will need to make a small tweak to your own dev environment to get the unit tests running for a non-Composer based install:
206
-
207
- * Copy your project's `phpunit.xml.dist` file to `phpunit.xml`.
208
- * Add the following to the `phpunit.xml` file within the `<phpunit>` tags, replacing `/path/to/PHPCSUtils` with the path in which you installed PHPCSUtils on your local system:
209
-
210
- ```xml
211
- <php>
212
- <env name="PHPCSUtils_DIR" value="/path/to/PHPCSUtils"/>
213
- </php>
214
- ```
215
-
216
-
217
- ## Frequently Asked Questions
218
-
219
- <div class="faq">
220
-
221
- ### Q: How does this all work without an external standard needing to register an autoloader?
222
-
223
- A: As PHPCSUtils is registered with PHPCS as an external standard and PHPCSUtils complies with the naming requirements of PHPCS, the PHPCS native autoloader will automatically take care of loading the classes used from PHPCSUtils.
224
-
225
- ### Q: Does using PHPCSUtils have any effect on the PHPCS native sniffs?
226
-
227
- A: No. PHPCSUtils will only work for those sniffs which explicitly use the PHPCSUtils functionality.
228
-
229
- If your standard includes both PHPCS native sniffs as well as your own sniffs, your own sniffs can benefit from the back-compat layer offered by PHPCSUtils, as well as from the additional utility functions. However, the PHPCS native sniffs will not receive those benefits, as PHPCS itself does not use PHPCSUtils.
230
-
231
- ### Q: Do the utilities work with javascript/CSS files?
232
-
233
- A: JS/CSS support will be removed from `PHP_CodeSniffer` in PHPCS 4.x.
234
- While at this time, some of the utilities _may_ work with JS/CSS files, PHPCSUtils does not offer formal support for JS/CSS sniffing with `PHP_CodeSniffer` and will stop any existing support once PHPCS 4.x has been released.
235
-
236
- ### Q: Are all file encodings supported?
237
-
238
- A: No. The UTF-8 file encoding is the only officially supported encoding. Support for other encodings may incidentally work, but is not officially supported.
239
-
240
- > **It is recommended to advise your users to save their files as UTF-8 encoded for the best results.**
241
-
242
- Note: `PHP_CodeSniffer` 3.x defaults to UTF-8 as the expected file encoding.
243
-
244
- </div>
245
-
246
-
247
- ## Potential Support Questions from your End-Users
248
-
249
- <div class="faq">
250
-
251
- ### Q: A user reports a fatal "class not found" error for a class from PHPCSUtils
252
-
253
- 1. Check that the version of PHPCSUtils the user has installed complies with the minimum version of PHPCSUtils your standard requires. If not, they will need to upgrade.
254
- 2. If the version is correct, this indicates that the end-user does not have PHPCSUtils installed and/or registered with PHP_CodeSniffer.
255
- - Please review your standard's installation instructions to make sure that PHPCSUtils will be installed when those are followed.
256
- - Inform the user to install PHPCSUtils and register it with PHP_CodeSniffer.
257
-
258
- ---
259
-
260
- > :bulb: **Pro-tip**: if you want to prevent the fatal error and show a _friendlier_ error message instead, add `<rule ref="PHPCSUtils"/>` to your standard's `ruleset.xml` file.
261
- >
262
- > With that in place, `PHP_CodeSniffer` will show a _"ERROR: the "PHPCSUtils" coding standard is not installed."_ message if PHPCSUtils is missing as soon as the ruleset loading is finished.
263
-
264
- ---
265
-
266
- > :bulb: **Pro-tip**: provide upgrade instructions for your end-users. For Composer-based installs, those should look like this:
267
- >
268
- > ```bash
269
- > composer update your/cs-package --with-[all-]dependencies
270
- > ```
271
- >
272
- > That way, when the user updates your coding standards package, they will automatically also update PHPCSUtils.
273
-
274
- ---
275
-
276
- </div>
277
-
278
-
279
- ## Contributing
280
-
281
- Contributions to this project are welcome. Clone the repo, branch off from `develop`, make your changes, commit them and send in a pull request.
282
-
283
- If you are unsure whether the changes you are proposing would be welcome, please open an issue first to discuss your proposal.
284
-
285
-
286
- ## License
287
-
288
- This code is released under the [GNU Lesser General Public License (LGPLv3)](LICENSE).
289
-
290
-
291
- [PHP_CodeSniffer]: https://github.com/PHPCSStandards/PHP_CodeSniffer
292
- [Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer
293
- [phpcsutils-repo]: https://github.com/PHPCSStandards/PHPCSUtils
294
- [phpcsutils-web]: https://phpcsutils.com/
295
- [phpcsutils-packagist]: https://packagist.org/packages/phpcsstandards/phpcsutils
296
- [phpcsutils-releases]: https://github.com/PHPCSStandards/PHPCSUtils/releases
297
- [phpcsutils-tests-gha]: https://github.com/PHPCSStandards/PHPCSUtils/actions/workflows/test.yml