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,245 +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\Sniffs\PHP;
11
-
12
- use PHP_CodeSniffer\Util\Tokens;
13
- use PHPCSUtils\BackCompat\BCFile;
14
- use PHPCSUtils\Utils\GetTokensAsString;
15
- use WordPressCS\WordPress\Helpers\RulesetPropertyHelper;
16
- use WordPressCS\WordPress\Sniff;
17
-
18
- /**
19
- * Discourage the use of the PHP error silencing operator.
20
- *
21
- * This sniff allows the error operator to be used with a select list
22
- * of functions, as no amount of error checking can prevent
23
- * PHP from throwing errors when those functions are used.
24
- *
25
- * @since 1.1.0
26
- */
27
- final class NoSilencedErrorsSniff extends Sniff {
28
-
29
- /**
30
- * Number of tokens to display in the error message to show
31
- * the error silencing context.
32
- *
33
- * @since 1.1.0
34
- *
35
- * @var int
36
- */
37
- public $context_length = 6;
38
-
39
- /**
40
- * Whether or not the `$allowedFunctionsList` should be used.
41
- *
42
- * Defaults to true.
43
- *
44
- * This property only affects whether the standard function list is used.
45
- * The custom allowed functions list, if set, will always be respected.
46
- *
47
- * @since 1.1.0
48
- * @since 3.0.0 Renamed from `$use_default_whitelist` to `$usePHPFunctionsList`.
49
- *
50
- * @var bool
51
- */
52
- public $usePHPFunctionsList = true;
53
-
54
- /**
55
- * User defined function list.
56
- *
57
- * Allows users to pass a list of additional functions for which to allow
58
- * the use of the silence operator. This list can be set in a custom ruleset.
59
- *
60
- * @since 1.1.0
61
- * @since 3.0.0 Renamed from `$custom_whitelist` to `$customAllowedFunctionsList`.
62
- *
63
- * @var string[]
64
- */
65
- public $customAllowedFunctionsList = array();
66
-
67
- /**
68
- * PHP native functions allow list.
69
- *
70
- * Errors caused by calls to any of these native PHP functions
71
- * are allowed to be silenced as file system permissions and such
72
- * can cause E_WARNINGs to be thrown which cannot be prevented via
73
- * error checking.
74
- *
75
- * Note: only calls to global functions - in contrast to class methods -
76
- * are taken into account.
77
- *
78
- * Only functions for which the PHP manual annotates that an
79
- * error will be thrown on failure are accepted into this list.
80
- *
81
- * @since 1.1.0
82
- * @since 3.0.0 Renamed from `$function_whitelist` to `$allowedFunctionsList`.
83
- *
84
- * @var array<string, true> Key is function name, value irrelevant.
85
- */
86
- protected $allowedFunctionsList = array(
87
- // Directory extension.
88
- 'chdir' => true,
89
- 'opendir' => true,
90
- 'scandir' => true,
91
-
92
- // File extension.
93
- 'file_exists' => true,
94
- 'file_get_contents' => true,
95
- 'file' => true,
96
- 'fileatime' => true,
97
- 'filectime' => true,
98
- 'filegroup' => true,
99
- 'fileinode' => true,
100
- 'filemtime' => true,
101
- 'fileowner' => true,
102
- 'fileperms' => true,
103
- 'filesize' => true,
104
- 'filetype' => true,
105
- 'fopen' => true,
106
- 'is_dir' => true,
107
- 'is_executable' => true,
108
- 'is_file' => true,
109
- 'is_link' => true,
110
- 'is_readable' => true,
111
- 'is_writable' => true,
112
- 'is_writeable' => true,
113
- 'lstat' => true,
114
- 'mkdir' => true,
115
- 'move_uploaded_file' => true,
116
- 'readfile' => true,
117
- 'readlink' => true,
118
- 'rename' => true,
119
- 'rmdir' => true,
120
- 'stat' => true,
121
- 'unlink' => true,
122
-
123
- // FTP extension.
124
- 'ftp_chdir' => true,
125
- 'ftp_login' => true,
126
- 'ftp_rename' => true,
127
-
128
- // Stream extension.
129
- 'stream_select' => true,
130
- 'stream_set_chunk_size' => true,
131
-
132
- // Zlib extension.
133
- 'deflate_add' => true,
134
- 'deflate_init' => true,
135
- 'inflate_add' => true,
136
- 'inflate_init' => true,
137
- 'readgzfile' => true,
138
-
139
- // LibXML extension.
140
- 'libxml_disable_entity_loader' => true, // PHP 8.0 deprecation warning, but function call still needed in select cases.
141
-
142
- // Miscellaneous other functions.
143
- 'imagecreatefromstring' => true,
144
- 'imagecreatefromwebp' => true,
145
- 'parse_url' => true, // Pre-PHP 5.3.3 an E_WARNING was thrown when URL parsing failed.
146
- 'unserialize' => true,
147
- );
148
-
149
- /**
150
- * Tokens which are regarded as empty for the purpose of determining
151
- * the name of the called function.
152
- *
153
- * This property is set from within the register() method.
154
- *
155
- * @since 1.1.0
156
- *
157
- * @var array<int|string, int|string>
158
- */
159
- private $empty_tokens = array();
160
-
161
- /**
162
- * Returns an array of tokens this test wants to listen for.
163
- *
164
- * @since 1.1.0
165
- *
166
- * @return array
167
- */
168
- public function register() {
169
- $this->empty_tokens = Tokens::$emptyTokens;
170
- $this->empty_tokens[ \T_NS_SEPARATOR ] = \T_NS_SEPARATOR;
171
- $this->empty_tokens[ \T_BITWISE_AND ] = \T_BITWISE_AND;
172
-
173
- return array(
174
- \T_ASPERAND,
175
- );
176
- }
177
-
178
- /**
179
- * Processes this test, when one of its tokens is encountered.
180
- *
181
- * @since 1.1.0
182
- *
183
- * @param int $stackPtr The position of the current token in the stack.
184
- */
185
- public function process_token( $stackPtr ) {
186
- // Handle the user-defined custom function list.
187
- $this->customAllowedFunctionsList = RulesetPropertyHelper::merge_custom_array( $this->customAllowedFunctionsList, array(), false );
188
- $this->customAllowedFunctionsList = array_map( 'strtolower', $this->customAllowedFunctionsList );
189
-
190
- /*
191
- * Check if the error silencing is done for one of the allowed functions.
192
- *
193
- * @internal The function call name determination is done even when there is no allow list active
194
- * to allow the metrics to be more informative.
195
- */
196
- $next_non_empty = $this->phpcsFile->findNext( $this->empty_tokens, ( $stackPtr + 1 ), null, true, null, true );
197
- if ( false !== $next_non_empty && \T_STRING === $this->tokens[ $next_non_empty ]['code'] ) {
198
- $has_parenthesis = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $next_non_empty + 1 ), null, true, null, true );
199
- if ( false !== $has_parenthesis && \T_OPEN_PARENTHESIS === $this->tokens[ $has_parenthesis ]['code'] ) {
200
- $function_name = strtolower( $this->tokens[ $next_non_empty ]['content'] );
201
- if ( ( true === $this->usePHPFunctionsList
202
- && isset( $this->allowedFunctionsList[ $function_name ] ) === true )
203
- || ( ! empty( $this->customAllowedFunctionsList )
204
- && in_array( $function_name, $this->customAllowedFunctionsList, true ) === true )
205
- ) {
206
- $this->phpcsFile->recordMetric( $stackPtr, 'Error silencing', 'silencing allowed function call: ' . $function_name );
207
- return;
208
- }
209
- }
210
- }
211
-
212
- $this->context_length = (int) $this->context_length;
213
- $context_length = $this->context_length;
214
- if ( $this->context_length <= 0 ) {
215
- $context_length = 2;
216
- }
217
-
218
- // Prepare the "Found" string to display.
219
- $end_of_statement = BCFile::findEndOfStatement( $this->phpcsFile, $stackPtr, \T_COMMA );
220
- if ( ( $end_of_statement - $stackPtr ) < $context_length ) {
221
- $context_length = ( $end_of_statement - $stackPtr );
222
- }
223
-
224
- $found = GetTokensAsString::compact( $this->phpcsFile, $stackPtr, ( $stackPtr + $context_length - 1 ), true ) . '...';
225
- $error_msg = 'Silencing errors is strongly discouraged. Use proper error checking instead.';
226
- $data = array();
227
- if ( $this->context_length > 0 ) {
228
- $error_msg .= ' Found: %s';
229
- $data[] = $found;
230
- }
231
-
232
- $this->phpcsFile->addWarning(
233
- $error_msg,
234
- $stackPtr,
235
- 'Discouraged',
236
- $data
237
- );
238
-
239
- if ( isset( $function_name ) ) {
240
- $this->phpcsFile->recordMetric( $stackPtr, 'Error silencing', '@' . $function_name );
241
- } else {
242
- $this->phpcsFile->recordMetric( $stackPtr, 'Error silencing', $found );
243
- }
244
- }
245
- }
@@ -1,73 +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\Sniffs\PHP;
11
-
12
- use WordPressCS\WordPress\AbstractFunctionRestrictionsSniff;
13
-
14
- /**
15
- * Perl compatible regular expressions (PCRE, preg_ functions) should be used in preference
16
- * to their POSIX counterparts.
17
- *
18
- * @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#regular-expressions
19
- * @link https://php-legacy-docs.zend.com/manual/php5/en/ref.regex
20
- *
21
- * @since 0.10.0 Previously this check was contained within the
22
- * `WordPress.VIP.RestrictedFunctions` and the
23
- * `WordPress.PHP.DiscouragedPHPFunctions` sniffs.
24
- * @since 0.13.0 Class name changed: this class is now namespaced.
25
- */
26
- final class POSIXFunctionsSniff extends AbstractFunctionRestrictionsSniff {
27
-
28
- /**
29
- * Groups of functions to restrict.
30
- *
31
- * Example: groups => array(
32
- * 'lambda' => array(
33
- * 'type' => 'error' | 'warning',
34
- * 'message' => 'Use anonymous functions instead please!',
35
- * 'functions' => array( 'file_get_contents', 'create_function' ),
36
- * )
37
- * )
38
- *
39
- * @return array
40
- */
41
- public function getGroups() {
42
- return array(
43
- 'ereg' => array(
44
- 'type' => 'error',
45
- 'message' => '%s() has been deprecated since PHP 5.3 and removed in PHP 7.0, please use preg_match() instead.',
46
- 'functions' => array(
47
- 'ereg',
48
- 'eregi',
49
- 'sql_regcase',
50
- ),
51
- ),
52
-
53
- 'ereg_replace' => array(
54
- 'type' => 'error',
55
- 'message' => '%s() has been deprecated since PHP 5.3 and removed in PHP 7.0, please use preg_replace() instead.',
56
- 'functions' => array(
57
- 'ereg_replace',
58
- 'eregi_replace',
59
- ),
60
- ),
61
-
62
- 'split' => array(
63
- 'type' => 'error',
64
- 'message' => '%s() has been deprecated since PHP 5.3 and removed in PHP 7.0, please use explode(), str_split() or preg_split() instead.',
65
- 'functions' => array(
66
- 'split',
67
- 'spliti',
68
- ),
69
- ),
70
-
71
- );
72
- }
73
- }
@@ -1,70 +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\Sniffs\PHP;
11
-
12
- use PHPCSUtils\Utils\PassedParameters;
13
- use WordPressCS\WordPress\AbstractFunctionParameterSniff;
14
-
15
- /**
16
- * Flag calling preg_quote() without the second ($delimiter) parameter.
17
- *
18
- * @since 1.0.0
19
- */
20
- final class PregQuoteDelimiterSniff extends AbstractFunctionParameterSniff {
21
-
22
- /**
23
- * The group name for this group of functions.
24
- *
25
- * @since 1.0.0
26
- *
27
- * @var string
28
- */
29
- protected $group_name = 'preg_quote';
30
-
31
- /**
32
- * List of functions this sniff should examine.
33
- *
34
- * @link https://www.php.net/preg_quote
35
- *
36
- * @since 1.0.0
37
- *
38
- * @var array<string, true> Key is function name, value irrelevant.
39
- */
40
- protected $target_functions = array(
41
- 'preg_quote' => true,
42
- );
43
-
44
- /**
45
- * Process the parameters of a matched function.
46
- *
47
- * @since 1.0.0
48
- *
49
- * @param int $stackPtr The position of the current token in the stack.
50
- * @param string $group_name The name of the group which was matched.
51
- * @param string $matched_content The token content (function name) which was matched
52
- * in lowercase.
53
- * @param array $parameters Array with information about the parameters.
54
- *
55
- * @return void
56
- */
57
- public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) {
58
-
59
- $delimiter = PassedParameters::getParameterFromStack( $parameters, 2, 'delimiter' );
60
- if ( false !== $delimiter ) {
61
- return;
62
- }
63
-
64
- $this->phpcsFile->addWarning(
65
- 'Passing the $delimiter parameter to preg_quote() is strongly recommended.',
66
- $stackPtr,
67
- 'Missing'
68
- );
69
- }
70
- }
@@ -1,45 +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\Sniffs\PHP;
11
-
12
- use WordPressCS\WordPress\AbstractFunctionRestrictionsSniff;
13
-
14
- /**
15
- * Forbids the use of various native PHP functions and suggests alternatives.
16
- *
17
- * @since 0.14.0
18
- */
19
- final class RestrictedPHPFunctionsSniff extends AbstractFunctionRestrictionsSniff {
20
-
21
- /**
22
- * Groups of functions to forbid.
23
- *
24
- * Example: groups => array(
25
- * 'lambda' => array(
26
- * 'type' => 'error' | 'warning',
27
- * 'message' => 'Use anonymous functions instead please!',
28
- * 'functions' => array( 'file_get_contents', 'create_function' ),
29
- * )
30
- * )
31
- *
32
- * @return array
33
- */
34
- public function getGroups() {
35
- return array(
36
- 'create_function' => array(
37
- 'type' => 'error',
38
- 'message' => '%s() is deprecated as of PHP 7.2 and removed in PHP 8.0. Please use declared named or anonymous functions instead.',
39
- 'functions' => array(
40
- 'create_function',
41
- ),
42
- ),
43
- );
44
- }
45
- }
@@ -1,122 +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\Sniffs\PHP;
11
-
12
- use PHPCSUtils\Utils\PassedParameters;
13
- use WordPressCS\WordPress\AbstractFunctionParameterSniff;
14
-
15
- /**
16
- * Flag calling in_array(), array_search() and array_keys() without true as the third parameter.
17
- *
18
- * @since 0.9.0
19
- * @since 0.10.0 - This sniff not only checks for `in_array()`, but also `array_search()`
20
- * and `array_keys()`.
21
- * - The sniff no longer needlessly extends the `ArrayAssignmentRestrictionsSniff`
22
- * class which it didn't use.
23
- * @since 0.11.0 Refactored to extend the new WordPressCS native `AbstractFunctionParameterSniff` class.
24
- * @since 0.13.0 Class name changed: this class is now namespaced.
25
- */
26
- final class StrictInArraySniff extends AbstractFunctionParameterSniff {
27
-
28
- /**
29
- * The group name for this group of functions.
30
- *
31
- * @since 0.11.0
32
- *
33
- * @var string
34
- */
35
- protected $group_name = 'strict';
36
-
37
- /**
38
- * List of array functions to which a $strict parameter can be passed.
39
- *
40
- * The array_keys() function only requires the $strict parameter when the optional
41
- * second parameter $filter_value has been set.
42
- *
43
- * @link https://www.php.net/in-array
44
- * @link https://www.php.net/array-search
45
- * @link https://www.php.net/array-keys
46
- *
47
- * @since 0.10.0
48
- * @since 0.11.0 Renamed from $array_functions to $target_functions.
49
- * @since 3.0.0 The format of the array value has changed from boolean to array.
50
- *
51
- * @var array<string, array{param_position: int, param_name: string, always_needed: bool}> Key is the function name.
52
- */
53
- protected $target_functions = array(
54
- 'in_array' => array(
55
- 'param_position' => 3,
56
- 'param_name' => 'strict',
57
- 'always_needed' => true,
58
- ),
59
- 'array_search' => array(
60
- 'param_position' => 3,
61
- 'param_name' => 'strict',
62
- 'always_needed' => true,
63
- ),
64
- 'array_keys' => array(
65
- 'param_position' => 3,
66
- 'param_name' => 'strict',
67
- 'always_needed' => false,
68
- ),
69
- );
70
-
71
- /**
72
- * Process the parameters of a matched function.
73
- *
74
- * @since 0.11.0
75
- *
76
- * @param int $stackPtr The position of the current token in the stack.
77
- * @param string $group_name The name of the group which was matched.
78
- * @param string $matched_content The token content (function name) which was matched
79
- * in lowercase.
80
- * @param array $parameters Array with information about the parameters.
81
- *
82
- * @return void
83
- */
84
- public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) {
85
- $param_info = $this->target_functions[ $matched_content ];
86
-
87
- /*
88
- * Check if the strict check is actually needed.
89
- *
90
- * Important! This check only applies to array_keys() in the current form of the sniff
91
- * and has been written to be specific to that function.
92
- * If more functions would be added with 'always_needed' set to `false`,
93
- * this code will need to be adjusted to handle those.
94
- */
95
- if ( false === $param_info['always_needed'] ) {
96
- $has_filter_value = PassedParameters::getParameterFromStack( $parameters, 2, 'filter_value' );
97
- if ( false === $has_filter_value ) {
98
- return;
99
- }
100
- }
101
-
102
- $found_parameter = PassedParameters::getParameterFromStack( $parameters, $param_info['param_position'], $param_info['param_name'] );
103
- if ( false === $found_parameter || 'true' !== strtolower( $found_parameter['clean'] ) ) {
104
- $errorcode = 'MissingTrueStrict';
105
-
106
- /*
107
- * Use a different error code when `false` is found to allow for excluding
108
- * the warning as this will be a conscious choice made by the dev.
109
- */
110
- if ( is_array( $found_parameter ) && 'false' === strtolower( $found_parameter['clean'] ) ) {
111
- $errorcode = 'FoundNonStrictFalse';
112
- }
113
-
114
- $this->phpcsFile->addWarning(
115
- 'Not using strict comparison for %s; supply true for $%s argument.',
116
- ( isset( $found_parameter['start'] ) ? $found_parameter['start'] : $stackPtr ),
117
- $errorcode,
118
- array( $matched_content, $param_info['param_name'] )
119
- );
120
- }
121
- }
122
- }
@@ -1,90 +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\Sniffs\PHP;
11
-
12
- use WordPressCS\WordPress\Sniff;
13
-
14
- /**
15
- * Verifies the correct usage of type cast keywords.
16
- *
17
- * Type casts should be:
18
- * - normalized, i.e. (float) not (real).
19
- *
20
- * Additionally, the use of the (unset) and (binary) casts is discouraged.
21
- *
22
- * @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#space-usage
23
- *
24
- * @since 1.2.0
25
- * @since 2.0.0 No longer checks that type casts are lowercase or short form.
26
- * Relevant PHPCS native sniffs have been included in the rulesets instead.
27
- */
28
- final class TypeCastsSniff extends Sniff {
29
-
30
- /**
31
- * Returns an array of tokens this test wants to listen for.
32
- *
33
- * @return array
34
- */
35
- public function register() {
36
- return array(
37
- \T_DOUBLE_CAST,
38
- \T_UNSET_CAST,
39
- \T_BINARY_CAST,
40
- );
41
- }
42
-
43
- /**
44
- * Processes this test, when one of its tokens is encountered.
45
- *
46
- * @param int $stackPtr The position of the current token in the stack.
47
- *
48
- * @return void
49
- */
50
- public function process_token( $stackPtr ) {
51
-
52
- $token_code = $this->tokens[ $stackPtr ]['code'];
53
- $typecast = str_replace( ' ', '', $this->tokens[ $stackPtr ]['content'] );
54
- $typecast_lc = strtolower( $typecast );
55
-
56
- switch ( $token_code ) {
57
- case \T_DOUBLE_CAST:
58
- if ( '(float)' !== $typecast_lc ) {
59
- $fix = $this->phpcsFile->addFixableError(
60
- 'Normalized type keywords must be used; expected "(float)" but found "%s"',
61
- $stackPtr,
62
- 'DoubleRealFound',
63
- array( $typecast )
64
- );
65
-
66
- if ( true === $fix ) {
67
- $this->phpcsFile->fixer->replaceToken( $stackPtr, '(float)' );
68
- }
69
- }
70
- break;
71
-
72
- case \T_UNSET_CAST:
73
- $this->phpcsFile->addError(
74
- 'Using the "(unset)" cast is forbidden as the type cast is removed in PHP 8.0. Use the "unset()" language construct instead.',
75
- $stackPtr,
76
- 'UnsetFound'
77
- );
78
- break;
79
-
80
- case \T_BINARY_CAST:
81
- $this->phpcsFile->addWarning(
82
- 'Using binary casting is strongly discouraged. Found: "%s"',
83
- $stackPtr,
84
- 'BinaryFound',
85
- array( $typecast )
86
- );
87
- break;
88
- }
89
- }
90
- }