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,256 +0,0 @@
1
- <?php
2
- /**
3
- * WordPress Coding Standard.
4
- *
5
- * @package WPCS\WordPressCodingStandards
6
- * @link https://github.com/WordPress/WordPress-Coding-Standards
7
- * @license https://opensource.org/licenses/MIT MIT
8
- */
9
-
10
- namespace WordPressCS\WordPress\Helpers;
11
-
12
- use WordPressCS\WordPress\Helpers\RulesetPropertyHelper;
13
-
14
- /**
15
- * Helper functions and function lists for checking whether an escaping function is being used.
16
- *
17
- * Any sniff class which incorporates this trait will automatically support the
18
- * following `public` properties which can be changed from within a custom ruleset:
19
- * - `customEscapingFunctions`.
20
- * - `customAutoEscapedFunctions`
21
- *
22
- * @since 3.0.0 The properties in this trait were previously contained partially in the
23
- * `WordPressCS\WordPress\Sniff` class and partially in the `EscapeOutputSniff`
24
- * class and have been moved here.
25
- */
26
- trait EscapingFunctionsTrait {
27
-
28
- /**
29
- * Custom list of functions which escape values for display.
30
- *
31
- * @since 0.5.0
32
- * @since 3.0.0 Moved from the EscapeOutput Sniff class to this trait.
33
- *
34
- * @var string[]
35
- */
36
- public $customEscapingFunctions = array();
37
-
38
- /**
39
- * Custom list of functions whose return values are pre-escaped for display.
40
- *
41
- * @since 0.3.0
42
- * @since 3.0.0 Moved from the EscapeOutput Sniff class to this trait.
43
- *
44
- * @var string[]
45
- */
46
- public $customAutoEscapedFunctions = array();
47
-
48
- /**
49
- * Functions that escape values for display.
50
- *
51
- * @since 0.5.0
52
- * @since 0.11.0 Changed from public static to protected non-static.
53
- * @since 3.0.0 - Moved from the Sniff class to this trait.
54
- * - Visibility changed from protected to private.
55
- *
56
- * @var array<string, bool>
57
- */
58
- private $escapingFunctions = array(
59
- 'absint' => true,
60
- 'esc_attr__' => true,
61
- 'esc_attr_e' => true,
62
- 'esc_attr_x' => true,
63
- 'esc_attr' => true,
64
- 'esc_html__' => true,
65
- 'esc_html_e' => true,
66
- 'esc_html_x' => true,
67
- 'esc_html' => true,
68
- 'esc_js' => true,
69
- 'esc_sql' => true,
70
- 'esc_textarea' => true,
71
- 'esc_url_raw' => true,
72
- 'esc_url' => true,
73
- 'esc_xml' => true,
74
- 'filter_input' => true,
75
- 'filter_var' => true,
76
- 'floatval' => true,
77
- 'highlight_string' => true,
78
- 'intval' => true,
79
- 'json_encode' => true,
80
- 'like_escape' => true,
81
- 'number_format' => true,
82
- 'rawurlencode' => true,
83
- 'sanitize_hex_color' => true,
84
- 'sanitize_hex_color_no_hash' => true,
85
- 'sanitize_html_class' => true,
86
- 'sanitize_key' => true,
87
- 'sanitize_locale_name' => true,
88
- 'sanitize_user_field' => true,
89
- 'tag_escape' => true,
90
- 'urlencode_deep' => true,
91
- 'urlencode' => true,
92
- 'wp_json_encode' => true,
93
- 'wp_kses_allowed_html' => true,
94
- 'wp_kses_data' => true,
95
- 'wp_kses_one_attr' => true,
96
- 'wp_kses_post' => true,
97
- 'wp_kses' => true,
98
- );
99
-
100
- /**
101
- * Functions whose output is automatically escaped for display.
102
- *
103
- * @since 0.5.0
104
- * @since 0.11.0 Changed from public static to protected non-static.
105
- * @since 3.0.0 - Moved from the Sniff class to this trait.
106
- * - Visibility changed from protected to private.
107
- *
108
- * @var array<string, bool>
109
- */
110
- private $autoEscapedFunctions = array(
111
- 'allowed_tags' => true,
112
- 'bloginfo' => true,
113
- 'body_class' => true,
114
- 'calendar_week_mod' => true,
115
- 'category_description' => true,
116
- 'checked' => true,
117
- 'comment_class' => true,
118
- 'count' => true,
119
- 'disabled' => true,
120
- 'do_shortcode' => true,
121
- 'do_shortcode_tag' => true,
122
- 'get_archives_link' => true,
123
- 'get_attachment_link' => true,
124
- 'get_avatar' => true,
125
- 'get_bookmark_field' => true,
126
- 'get_calendar' => true,
127
- 'get_comment_author_link' => true,
128
- 'get_current_blog_id' => true,
129
- 'get_delete_post_link' => true,
130
- 'get_search_form' => true,
131
- 'get_search_query' => true,
132
- 'get_the_author_link' => true,
133
- 'get_the_author' => true,
134
- 'get_the_date' => true,
135
- 'get_the_ID' => true,
136
- 'get_the_post_thumbnail' => true,
137
- 'get_the_term_list' => true,
138
- 'post_type_archive_title' => true,
139
- 'readonly' => true,
140
- 'selected' => true,
141
- 'single_cat_title' => true,
142
- 'single_month_title' => true,
143
- 'single_post_title' => true,
144
- 'single_tag_title' => true,
145
- 'single_term_title' => true,
146
- 'tag_description' => true,
147
- 'term_description' => true,
148
- 'the_author' => true,
149
- 'the_date' => true,
150
- 'the_title_attribute' => true,
151
- 'walk_nav_menu_tree' => true,
152
- 'wp_dropdown_categories' => true,
153
- 'wp_dropdown_users' => true,
154
- 'wp_generate_tag_cloud' => true,
155
- 'wp_get_archives' => true,
156
- 'wp_get_attachment_image' => true,
157
- 'wp_get_attachment_link' => true,
158
- 'wp_link_pages' => true,
159
- 'wp_list_authors' => true,
160
- 'wp_list_bookmarks' => true,
161
- 'wp_list_categories' => true,
162
- 'wp_list_comments' => true,
163
- 'wp_login_form' => true,
164
- 'wp_loginout' => true,
165
- 'wp_nav_menu' => true,
166
- 'wp_readonly' => true,
167
- 'wp_register' => true,
168
- 'wp_tag_cloud' => true,
169
- 'wp_timezone_choice' => true,
170
- 'wp_title' => true,
171
- );
172
-
173
- /**
174
- * Cache of previously added custom functions.
175
- *
176
- * Prevents having to do the same merges over and over again.
177
- *
178
- * @since 0.4.0
179
- * @since 0.11.0 - Changed from public static to protected non-static.
180
- * - Changed the format from simple bool to array.
181
- * @since 3.0.0 - Moved from the EscapeOutput Sniff class to this trait.
182
- * - Visibility changed from protected to private.
183
- *
184
- * @var array<string, string[]>
185
- */
186
- private $addedCustomEscapingFunctions = array(
187
- 'escape' => array(),
188
- 'autoescape' => array(),
189
- );
190
-
191
- /**
192
- * Combined list of WP native and custom escaping functions.
193
- *
194
- * @since 3.0.0
195
- *
196
- * @var array<string, bool>
197
- */
198
- private $allEscapingFunctions = array();
199
-
200
- /**
201
- * Combined list of WP native and custom auto-escaping functions.
202
- *
203
- * @since 3.0.0
204
- *
205
- * @var array<string, bool>
206
- */
207
- private $allAutoEscapedFunctions = array();
208
-
209
- /**
210
- * Check if a particular function is regarded as an escaping function.
211
- *
212
- * @since 3.0.0
213
- *
214
- * @param string $functionName The name of the function to check.
215
- *
216
- * @return bool
217
- */
218
- final public function is_escaping_function( $functionName ) {
219
- if ( array() === $this->allEscapingFunctions
220
- || $this->customEscapingFunctions !== $this->addedCustomEscapingFunctions['escape']
221
- ) {
222
- $this->allEscapingFunctions = RulesetPropertyHelper::merge_custom_array(
223
- $this->customEscapingFunctions,
224
- $this->escapingFunctions
225
- );
226
-
227
- $this->addedCustomEscapingFunctions['escape'] = $this->customEscapingFunctions;
228
- }
229
-
230
- return isset( $this->allEscapingFunctions[ strtolower( $functionName ) ] );
231
- }
232
-
233
- /**
234
- * Check if a particular function is regarded as an auto-escaped function.
235
- *
236
- * @since 3.0.0
237
- *
238
- * @param string $functionName The name of the function to check.
239
- *
240
- * @return bool
241
- */
242
- final public function is_auto_escaped_function( $functionName ) {
243
- if ( array() === $this->allAutoEscapedFunctions
244
- || $this->customAutoEscapedFunctions !== $this->addedCustomEscapingFunctions['autoescape']
245
- ) {
246
- $this->allAutoEscapedFunctions = RulesetPropertyHelper::merge_custom_array(
247
- $this->customAutoEscapedFunctions,
248
- $this->autoEscapedFunctions
249
- );
250
-
251
- $this->addedCustomEscapingFunctions['autoescape'] = $this->customAutoEscapedFunctions;
252
- }
253
-
254
- return isset( $this->allAutoEscapedFunctions[ strtolower( $functionName ) ] );
255
- }
256
- }
@@ -1,60 +0,0 @@
1
- <?php
2
- /**
3
- * WordPress Coding Standard.
4
- *
5
- * @package WPCS\WordPressCodingStandards
6
- * @link https://github.com/WordPress/WordPress-Coding-Standards
7
- * @license https://opensource.org/licenses/MIT MIT
8
- */
9
-
10
- namespace WordPressCS\WordPress\Helpers;
11
-
12
- /**
13
- * Helper functions and function lists for checking whether a function is a formatting function.
14
- *
15
- * @since 3.0.0 The property in this class was previously contained in the
16
- * `WordPressCS\WordPress\Sniff` class and has been moved here.
17
- */
18
- final class FormattingFunctionsHelper {
19
-
20
- /**
21
- * Functions that format strings.
22
- *
23
- * These functions are often used for formatting values just before output, and
24
- * it is common practice to escape the individual parameters passed to them as
25
- * needed instead of escaping the entire result. This is especially true when the
26
- * string being formatted contains HTML, which makes escaping the full result
27
- * more difficult.
28
- *
29
- * @since 0.5.0
30
- * @since 0.11.0 Changed from public static to protected non-static.
31
- * @since 3.0.0 - Moved from the Sniff class to this class.
32
- * - Visibility changed from protected to private and property made static.
33
- *
34
- * @var array<string, bool>
35
- */
36
- private static $formattingFunctions = array(
37
- 'antispambot' => true,
38
- 'array_fill' => true,
39
- 'ent2ncr' => true,
40
- 'implode' => true,
41
- 'join' => true,
42
- 'nl2br' => true,
43
- 'sprintf' => true,
44
- 'vsprintf' => true,
45
- 'wp_sprintf' => true,
46
- );
47
-
48
- /**
49
- * Check if a particular function is regarded as a formatting function.
50
- *
51
- * @since 3.0.0
52
- *
53
- * @param string $functionName The name of the function to check.
54
- *
55
- * @return bool
56
- */
57
- public static function is_formatting_function( $functionName ) {
58
- return isset( self::$formattingFunctions[ strtolower( $functionName ) ] );
59
- }
60
- }
@@ -1,238 +0,0 @@
1
- <?php
2
- /**
3
- * WordPress Coding Standard.
4
- *
5
- * @package WPCS\WordPressCodingStandards
6
- * @link https://github.com/WordPress/WordPress-Coding-Standards
7
- * @license https://opensource.org/licenses/MIT MIT
8
- */
9
-
10
- namespace WordPressCS\WordPress\Helpers;
11
-
12
- use PHP_CodeSniffer\Files\File;
13
- use PHP_CodeSniffer\Util\Tokens;
14
- use PHPCSUtils\Utils\Namespaces;
15
- use PHPCSUtils\Utils\ObjectDeclarations;
16
- use WordPressCS\WordPress\Helpers\RulesetPropertyHelper;
17
-
18
- /**
19
- * Helper utilities for sniffs which need to take into account whether the
20
- * code under examination is unit test code or not.
21
- *
22
- * Usage instructions:
23
- * - Add appropriate `use` statement(s) to the file/class which intends to use this functionality.
24
- * - Now the sniff will automatically support the public `custom_test_classes` property which
25
- * users can set in their custom ruleset. Do not add the property to the sniff!
26
- * - The sniff can call the `is_test_class()` method in this trait to verify if a class is
27
- * a test class. The `is_test_class()` method will take the custom property into account.
28
- *
29
- * @since 3.0.0 The properties and method in this trait were previously contained in the
30
- * `WordPressCS\WordPress\Sniff` class and have been moved here.
31
- */
32
- trait IsUnitTestTrait {
33
-
34
- /**
35
- * Custom list of classes which test classes can extend.
36
- *
37
- * This property allows end-users to add to the build-in `$known_test_classes`
38
- * via their custom PHPCS ruleset.
39
- * This property will need to be set for each sniff which uses this trait.
40
- *
41
- * Currently this property is used by the `WordPress.WP.GlobalVariablesOverride`,
42
- * `WordPress.NamingConventions.PrefixAllGlobals` and the `WordPress.Files.Filename` sniffs.
43
- *
44
- * Example usage:
45
- * ```xml
46
- * <rule ref="WordPress.[Subset].[Sniffname]">
47
- * <properties>
48
- * <property name="custom_test_classes" type="array">
49
- * <element value="My_Plugin_First_Test_Class"/>
50
- * <element value="My_Plugin_Second_Test_Class"/>
51
- * </property>
52
- * </properties>
53
- * </rule>
54
- * ```
55
- *
56
- * Note: it is strongly _recommended_ to exclude your test directories for
57
- * select error codes of those particular sniffs instead of relying on this
58
- * property/trait.
59
- *
60
- * @since 0.11.0
61
- * @since 3.0.0 Moved from the Sniff class to this dedicated Trait.
62
- * Renamed from `$custom_test_class_whitelist` to `$custom_test_classes`.
63
- *
64
- * @var string[]
65
- */
66
- public $custom_test_classes = array();
67
-
68
- /**
69
- * List of PHPUnit and WP native classes which test classes can extend.
70
- *
71
- * {internal These are the test cases provided in the `/tests/phpunit/includes/`
72
- * directory of WP Core.}
73
- *
74
- * @since 0.11.0
75
- * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait.
76
- * - Renamed from `$test_class_whitelist` to `$known_test_classes`.
77
- * - Visibility changed from protected to private.
78
- *
79
- * @var array<string, true> Key is class name, value irrelevant.
80
- */
81
- private $known_test_classes = array(
82
- // Base test cases.
83
- 'WP_UnitTestCase' => true,
84
- 'WP_UnitTestCase_Base' => true,
85
- 'PHPUnit_Adapter_TestCase' => true,
86
-
87
- // Domain specific base test cases.
88
- 'WP_Ajax_UnitTestCase' => true,
89
- 'WP_Canonical_UnitTestCase' => true,
90
- 'WP_Font_Face_UnitTestCase' => true,
91
- 'WP_Test_REST_Controller_Testcase' => true,
92
- 'WP_Test_REST_Post_Type_Controller_Testcase' => true,
93
- 'WP_Test_REST_TestCase' => true,
94
- 'WP_Test_XML_TestCase' => true,
95
- 'WP_XMLRPC_UnitTestCase' => true,
96
-
97
- // PHPUnit native test cases.
98
- 'PHPUnit_Framework_TestCase' => true,
99
- 'PHPUnit\\Framework\\TestCase' => true,
100
- // PHPUnit native TestCase class when imported via use statement.
101
- 'TestCase' => true,
102
- );
103
-
104
- /**
105
- * Cache of previously added custom test classes.
106
- *
107
- * Prevents having to do the same merges over and over again.
108
- *
109
- * @since 3.0.0
110
- *
111
- * @var string[]
112
- */
113
- private $added_custom_test_classes = array();
114
-
115
- /**
116
- * Combined list of WP/PHPUnit native and custom test classes.
117
- *
118
- * @since 3.0.0
119
- *
120
- * @var array<string, bool>
121
- */
122
- private $all_test_classes = array();
123
-
124
- /**
125
- * Retrieve a list of all registered test classes, both WP/PHPUnit native as well as custom.
126
- *
127
- * @since 3.0.0
128
- *
129
- * @return array<string, bool>
130
- */
131
- final protected function get_all_test_classes() {
132
- if ( array() === $this->all_test_classes
133
- || $this->custom_test_classes !== $this->added_custom_test_classes
134
- ) {
135
- /*
136
- * Show some tolerance for user input.
137
- * The custom test class names should be passed as FQN without a prefixing `\`.
138
- */
139
- $custom_test_classes = array();
140
- if ( ! empty( $this->custom_test_classes ) ) {
141
- foreach ( $this->custom_test_classes as $v ) {
142
- $custom_test_classes[] = ltrim( $v, '\\' );
143
- }
144
- }
145
-
146
- /*
147
- * Lowercase all names, both custom as well as "known", as PHP treats namespaced names case-insensitively.
148
- */
149
- $custom_test_classes = array_map( 'strtolower', $custom_test_classes );
150
- $known_test_classes = array_change_key_case( $this->known_test_classes, \CASE_LOWER );
151
-
152
- $this->all_test_classes = RulesetPropertyHelper::merge_custom_array(
153
- $custom_test_classes,
154
- $known_test_classes
155
- );
156
-
157
- // Store the original value so the comparison can succeed.
158
- $this->added_custom_test_classes = $this->custom_test_classes;
159
- }
160
-
161
- return $this->all_test_classes;
162
- }
163
-
164
- /**
165
- * Check if a class token is part of a unit test suite.
166
- *
167
- * Unit test classes are identified as such:
168
- * - Class which either extends one of the known test cases, such as `WP_UnitTestCase`
169
- * or `PHPUnit_Framework_TestCase` or extends a custom unit test class as listed in the
170
- * `custom_test_classes` property.
171
- *
172
- * @since 0.12.0 Split off from the `is_token_in_test_method()` method.
173
- * @since 1.0.0 Improved recognition of namespaced class names.
174
- * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait.
175
- * - The `$phpcsFile` parameter was added.
176
- *
177
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
178
- * @param int $stackPtr The position of the token to be examined.
179
- * This should be a class, anonymous class or trait token.
180
- *
181
- * @return bool True if the class is a unit test class, false otherwise.
182
- */
183
- final protected function is_test_class( File $phpcsFile, $stackPtr ) {
184
-
185
- $tokens = $phpcsFile->getTokens();
186
-
187
- if ( isset( $tokens[ $stackPtr ], Tokens::$ooScopeTokens[ $tokens[ $stackPtr ]['code'] ] ) === false ) {
188
- return false;
189
- }
190
-
191
- // Add any potentially extra custom test classes to the known test classes list.
192
- $known_test_classes = $this->get_all_test_classes();
193
-
194
- $namespace = strtolower( Namespaces::determineNamespace( $phpcsFile, $stackPtr ) );
195
-
196
- // Is the class/trait one of the known test classes ?
197
- $className = ObjectDeclarations::getName( $phpcsFile, $stackPtr );
198
- if ( empty( $className ) === false ) {
199
- $className = strtolower( $className );
200
- if ( '' !== $namespace ) {
201
- if ( isset( $known_test_classes[ $namespace . '\\' . $className ] ) ) {
202
- return true;
203
- }
204
- } elseif ( isset( $known_test_classes[ $className ] ) ) {
205
- return true;
206
- }
207
- }
208
-
209
- // Does the class/trait extend one of the known test classes ?
210
- $extendedClassName = ObjectDeclarations::findExtendedClassName( $phpcsFile, $stackPtr );
211
- if ( false === $extendedClassName ) {
212
- return false;
213
- }
214
-
215
- $extendedClassName = strtolower( $extendedClassName );
216
-
217
- if ( '\\' === $extendedClassName[0] ) {
218
- if ( isset( $known_test_classes[ substr( $extendedClassName, 1 ) ] ) ) {
219
- return true;
220
- }
221
- } elseif ( '' !== $namespace ) {
222
- if ( isset( $known_test_classes[ $namespace . '\\' . $extendedClassName ] ) ) {
223
- return true;
224
- }
225
- } elseif ( isset( $known_test_classes[ $extendedClassName ] ) ) {
226
- return true;
227
- }
228
-
229
- /*
230
- * Not examining imported classes via `use` statements as with the variety of syntaxes,
231
- * this would get very complicated.
232
- * After all, users can add an `<exclude-pattern>` for a particular sniff to their
233
- * custom ruleset to selectively exclude the test directory.
234
- */
235
-
236
- return false;
237
- }
238
- }
@@ -1,101 +0,0 @@
1
- <?php
2
- /**
3
- * WordPress Coding Standard.
4
- *
5
- * @package WPCS\WordPressCodingStandards
6
- * @link https://github.com/WordPress/WordPress-Coding-Standards
7
- * @license https://opensource.org/licenses/MIT MIT
8
- */
9
-
10
- namespace WordPressCS\WordPress\Helpers;
11
-
12
- use PHP_CodeSniffer\Exceptions\RuntimeException;
13
- use PHP_CodeSniffer\Files\File;
14
- use PHPCSUtils\Tokens\Collections;
15
- use PHPCSUtils\Utils\Lists;
16
-
17
- /**
18
- * Helper utilities for checking the context in which a token is used.
19
- *
20
- * ---------------------------------------------------------------------------------------------
21
- * This class is only intended for internal use by WordPressCS and is not part of the public API.
22
- * This also means that it has no promise of backward compatibility. Use at your own risk.
23
- * ---------------------------------------------------------------------------------------------
24
- *
25
- * {@internal The functionality in this class will likely be replaced at some point in
26
- * the future by functions from PHPCSUtils.}
27
- *
28
- * @internal
29
- *
30
- * @since 3.0.0 The method in this class was previously contained in the
31
- * `WordPressCS\WordPress\Sniff` class and has been moved here.
32
- */
33
- final class ListHelper {
34
-
35
- /**
36
- * Get a list of the token pointers to the variables being assigned to in a list statement.
37
- *
38
- * {@internal No need to take special measures for nested lists. Nested or not,
39
- * each list part can only contain one variable being written to.}
40
- *
41
- * @since 2.2.0
42
- * @since 3.0.0 - Moved from the Sniff class to this class.
43
- * - The method visibility was changed from `protected` to `public static`.
44
- * - The `$phpcsFile` parameter was added.
45
- * - The `$list_open_close` parameter was dropped.
46
- *
47
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
48
- * @param int $stackPtr The position of the T_LIST or T_OPEN_SHORT_ARRAY
49
- * token in the stack.
50
- *
51
- * @return array Array with the stack pointers to the variables or an empty
52
- * array when not a (short) list.
53
- */
54
- public static function get_list_variables( File $phpcsFile, $stackPtr ) {
55
- $tokens = $phpcsFile->getTokens();
56
-
57
- // Is this one of the tokens this function handles ?
58
- if ( isset( $tokens[ $stackPtr ], Collections::listOpenTokensBC()[ $tokens[ $stackPtr ]['code'] ] ) === false ) {
59
- return array();
60
- }
61
-
62
- if ( isset( Collections::shortArrayListOpenTokensBC()[ $tokens[ $stackPtr ]['code'] ] )
63
- && Lists::isShortList( $phpcsFile, $stackPtr ) === false
64
- ) {
65
- return array();
66
- }
67
-
68
- try {
69
- $assignments = Lists::getAssignments( $phpcsFile, $stackPtr );
70
- } catch ( RuntimeException $e ) {
71
- // Parse error/live coding.
72
- return array();
73
- }
74
-
75
- $var_pointers = array();
76
-
77
- foreach ( $assignments as $assign ) {
78
- if ( true === $assign['is_empty'] ) {
79
- continue;
80
- }
81
-
82
- if ( true === $assign['is_nested_list'] ) {
83
- /*
84
- * Recurse into the nested list and get the variables.
85
- * No need to `catch` any errors as only lists can be nested in lists.
86
- */
87
- $var_pointers += self::get_list_variables( $phpcsFile, $assign['assignment_token'] );
88
- continue;
89
- }
90
-
91
- /*
92
- * Ok, so this must be a "normal" assignment in the list.
93
- * Set the variable pointer both as the key as well as the value, so we can use array join
94
- * for nested lists (above).
95
- */
96
- $var_pointers[ $assign['assignment_token'] ] = $assign['assignment_token'];
97
- }
98
-
99
- return $var_pointers;
100
- }
101
- }