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.
- package/composer.json +2 -3
- package/composer.lock +3 -313
- package/index.js +38 -21
- package/lib/blocks.js +8 -6
- package/lib/style.js +17 -0
- package/package.json +1 -1
- package/vendor/composer/autoload_classmap.php +0 -37
- package/vendor/composer/autoload_psr4.php +0 -1
- package/vendor/composer/autoload_real.php +2 -0
- package/vendor/composer/autoload_static.php +0 -53
- package/vendor/composer/installed.json +1 -329
- package/vendor/composer/installed.php +3 -39
- package/vendor/composer/platform_check.php +26 -0
- package/lib/bustCache.js +0 -14
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md +0 -22
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/README.md +0 -285
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/composer.json +0 -71
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php +0 -637
- package/vendor/phpcsstandards/phpcsextra/CHANGELOG.md +0 -590
- package/vendor/phpcsstandards/phpcsextra/LICENSE +0 -165
- package/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml +0 -40
- package/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php +0 -382
- package/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml +0 -5
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml +0 -94
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml +0 -43
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php +0 -305
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php +0 -226
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml +0 -5
- package/vendor/phpcsstandards/phpcsextra/README.md +0 -573
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml +0 -44
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml +0 -40
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml +0 -31
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml +0 -24
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml +0 -64
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml +0 -26
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml +0 -43
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml +0 -30
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml +0 -35
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml +0 -49
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml +0 -37
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml +0 -45
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml +0 -42
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml +0 -33
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml +0 -31
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml +0 -30
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml +0 -26
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml +0 -44
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml +0 -29
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml +0 -33
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml +0 -41
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml +0 -39
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml +0 -29
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml +0 -30
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml +0 -31
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml +0 -94
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml +0 -29
- package/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php +0 -60
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php +0 -89
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php +0 -297
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php +0 -174
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php +0 -134
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php +0 -112
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php +0 -116
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php +0 -188
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php +0 -81
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php +0 -102
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php +0 -153
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php +0 -269
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php +0 -131
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php +0 -216
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php +0 -106
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php +0 -199
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php +0 -89
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php +0 -216
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php +0 -348
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php +0 -164
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php +0 -190
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php +0 -233
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php +0 -120
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php +0 -71
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php +0 -86
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php +0 -81
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php +0 -80
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php +0 -81
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php +0 -96
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php +0 -190
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php +0 -275
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php +0 -204
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php +0 -112
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php +0 -76
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php +0 -197
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php +0 -116
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php +0 -85
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php +0 -87
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php +0 -101
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php +0 -248
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php +0 -207
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php +0 -156
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php +0 -170
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php +0 -155
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php +0 -79
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php +0 -408
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php +0 -173
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php +0 -445
- package/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml +0 -5
- package/vendor/phpcsstandards/phpcsextra/composer.json +0 -69
- package/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist +0 -36
- package/vendor/phpcsstandards/phpcsutils/CHANGELOG.md +0 -1106
- package/vendor/phpcsstandards/phpcsutils/LICENSE +0 -165
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php +0 -551
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php +0 -781
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php +0 -123
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php +0 -202
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php +0 -44
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php +0 -47
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php +0 -43
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php +0 -50
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php +0 -246
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php +0 -218
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php +0 -687
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php +0 -269
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php +0 -164
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php +0 -75
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php +0 -459
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php +0 -837
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php +0 -55
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php +0 -227
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php +0 -156
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php +0 -232
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php +0 -276
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php +0 -828
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php +0 -262
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php +0 -359
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php +0 -145
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php +0 -389
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php +0 -116
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php +0 -322
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php +0 -359
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php +0 -252
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php +0 -120
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php +0 -419
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php +0 -510
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php +0 -143
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php +0 -331
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php +0 -432
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php +0 -333
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml +0 -4
- package/vendor/phpcsstandards/phpcsutils/README.md +0 -297
- package/vendor/phpcsstandards/phpcsutils/composer.json +0 -92
- package/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php +0 -68
- package/vendor/wp-coding-standards/wpcs/CHANGELOG.md +0 -1654
- package/vendor/wp-coding-standards/wpcs/LICENSE +0 -21
- package/vendor/wp-coding-standards/wpcs/README.md +0 -261
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php +0 -261
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php +0 -257
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php +0 -111
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php +0 -358
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml +0 -116
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml +0 -31
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml +0 -50
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml +0 -24
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml +0 -35
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml +0 -54
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml +0 -119
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml +0 -35
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml +0 -121
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml +0 -40
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml +0 -53
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml +0 -27
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml +0 -69
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml +0 -43
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml +0 -45
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml +0 -40
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml +0 -92
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml +0 -57
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml +0 -73
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml +0 -27
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml +0 -150
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml +0 -19
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml +0 -61
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php +0 -108
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php +0 -135
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php +0 -394
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php +0 -84
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php +0 -256
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php +0 -60
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php +0 -238
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php +0 -101
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php +0 -159
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php +0 -122
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php +0 -73
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php +0 -418
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php +0 -60
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/UnslashingFunctionsHelper.php +0 -59
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php +0 -349
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php +0 -262
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php +0 -115
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php +0 -312
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php +0 -113
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php +0 -72
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php +0 -252
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php +0 -550
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php +0 -174
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php +0 -583
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php +0 -173
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php +0 -89
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php +0 -301
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php +0 -761
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php +0 -242
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php +0 -57
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php +0 -63
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php +0 -58
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php +0 -168
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php +0 -59
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php +0 -313
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php +0 -1297
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php +0 -188
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php +0 -277
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php +0 -230
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php +0 -289
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php +0 -63
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php +0 -100
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php +0 -52
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php +0 -193
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php +0 -245
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php +0 -73
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php +0 -70
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php +0 -45
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php +0 -122
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php +0 -90
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php +0 -124
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php +0 -903
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php +0 -422
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php +0 -126
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php +0 -45
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php +0 -244
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php +0 -862
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php +0 -371
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php +0 -478
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php +0 -315
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php +0 -897
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php +0 -321
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php +0 -152
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php +0 -1708
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php +0 -291
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php +0 -509
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php +0 -160
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php +0 -54
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php +0 -241
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php +0 -108
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php +0 -436
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php +0 -977
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php +0 -102
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php +0 -59
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +0 -486
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +0 -63
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php +0 -60
- package/vendor/wp-coding-standards/wpcs/WordPress/ruleset.xml +0 -13
- package/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml +0 -948
- package/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml +0 -109
- package/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml +0 -199
- package/vendor/wp-coding-standards/wpcs/composer.json +0 -88
- package/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample +0 -153
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2009 John Godley and contributors.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
<div aria-hidden="true">
|
|
2
|
-
|
|
3
|
-
[](https://packagist.org/packages/wp-coding-standards/wpcs)
|
|
4
|
-
[](https://github.com/WordPress/WordPress-Coding-Standards/releases)
|
|
5
|
-
:construction:
|
|
6
|
-
[](https://packagist.org/packages/wp-coding-standards/wpcs#dev-develop)
|
|
7
|
-
|
|
8
|
-
[](https://github.com/WordPress/WordPress-Coding-Standards/actions/workflows/basic-qa.yml)
|
|
9
|
-
[](https://github.com/WordPress/WordPress-Coding-Standards/actions/workflows/unit-tests.yml)
|
|
10
|
-
[](https://codecov.io/gh/WordPress/WordPress-Coding-Standards?branch=develop)
|
|
11
|
-
|
|
12
|
-
[](https://packagist.org/packages/wp-coding-standards/wpcs)
|
|
13
|
-
[](https://github.com/WordPress/WordPress-Coding-Standards/actions/workflows/unit-tests.yml)
|
|
14
|
-
|
|
15
|
-
[](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/LICENSE)
|
|
16
|
-
[](https://packagist.org/packages/wp-coding-standards/wpcs/stats)
|
|
17
|
-
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# WordPress Coding Standards for PHP_CodeSniffer
|
|
22
|
-
|
|
23
|
-
* [Introduction](#introduction)
|
|
24
|
-
* [Minimum Requirements](#minimum-requirements)
|
|
25
|
-
* [Installation](#installation)
|
|
26
|
-
+ [Composer Project-based Installation](#composer-project-based-installation)
|
|
27
|
-
+ [Composer Global Installation](#composer-global-installation)
|
|
28
|
-
+ [Updating your WordPressCS install to a newer version](#updating-your-wordpresscs-install-to-a-newer-version)
|
|
29
|
-
+ [Using your WordPressCS install](#using-your-wordpresscs-install)
|
|
30
|
-
* [Rulesets](#rulesets)
|
|
31
|
-
+ [Standards subsets](#standards-subsets)
|
|
32
|
-
+ [Using a custom ruleset](#using-a-custom-ruleset)
|
|
33
|
-
+ [Customizing sniff behaviour](#customizing-sniff-behaviour)
|
|
34
|
-
+ [Recommended additional rulesets](#recommended-additional-rulesets)
|
|
35
|
-
* [How to use](#how-to-use)
|
|
36
|
-
+ [Command line](#command-line)
|
|
37
|
-
+ [Using PHPCS and WordPressCS from within your IDE](#using-phpcs-and-wordpresscs-from-within-your-ide)
|
|
38
|
-
* [Running your code through WordPressCS automatically using Continuous Integration tools](#running-your-code-through-wordpresscs-automatically-using-continuous-integration-tools)
|
|
39
|
-
* [Fixing errors or ignoring them](#fixing-errors-or-ignoring-them)
|
|
40
|
-
+ [Tools shipped with WordPressCS](#tools-shipped-with-wordpresscs)
|
|
41
|
-
* [Contributing](#contributing)
|
|
42
|
-
* [Funding](#funding)
|
|
43
|
-
* [License](#license)
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Introduction
|
|
48
|
-
|
|
49
|
-
This project is a collection of [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) rules (sniffs) to validate code developed for WordPress. It ensures code quality and adherence to coding conventions, especially the official [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
|
|
50
|
-
|
|
51
|
-
This project needs funding. [Find out how you can help](#funding).
|
|
52
|
-
|
|
53
|
-
## Minimum Requirements
|
|
54
|
-
|
|
55
|
-
The WordPress Coding Standards package requires:
|
|
56
|
-
* PHP 5.4 or higher with the following extensions enabled:
|
|
57
|
-
- [Filter](https://www.php.net/book.filter)
|
|
58
|
-
- [libxml](https://www.php.net/book.libxml)
|
|
59
|
-
- [Tokenizer](https://www.php.net/book.tokenizer)
|
|
60
|
-
- [XMLReader](https://www.php.net/book.xmlreader)
|
|
61
|
-
* [Composer](https://getcomposer.org/)
|
|
62
|
-
|
|
63
|
-
For the best results, it is recommended to also ensure the following additional PHP extensions are enabled:
|
|
64
|
-
- [iconv](https://www.php.net/book.iconv)
|
|
65
|
-
- [Multibyte String](https://www.php.net/book.mbstring)
|
|
66
|
-
|
|
67
|
-
## Installation
|
|
68
|
-
|
|
69
|
-
As of [WordPressCS 3.0.0](https://make.wordpress.org/core/2023/08/21/wordpresscs-3-0-0-is-now-available/), installation via Composer using the below instructions is the only supported type of installation.
|
|
70
|
-
|
|
71
|
-
[Composer](https://getcomposer.org/) will automatically install the project dependencies and register the rulesets from WordPressCS and other external standards with PHP_CodeSniffer using the [Composer PHPCS plugin](https://github.com/PHPCSStandards/composer-installer).
|
|
72
|
-
|
|
73
|
-
> If you are upgrading from an older WordPressCS version to version 3.0.0, please read the [Upgrade guide for ruleset maintainers and end-users](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-ruleset-maintainers) first!
|
|
74
|
-
|
|
75
|
-
### Composer Project-based Installation
|
|
76
|
-
|
|
77
|
-
Run the following from the root of your project:
|
|
78
|
-
```bash
|
|
79
|
-
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
|
|
80
|
-
composer require --dev wp-coding-standards/wpcs:"^3.0"
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Composer Global Installation
|
|
84
|
-
|
|
85
|
-
Alternatively, you may want to install this standard globally:
|
|
86
|
-
```bash
|
|
87
|
-
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
|
|
88
|
-
composer global require --dev wp-coding-standards/wpcs:"^3.0"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Updating your WordPressCS install to a newer version
|
|
92
|
-
|
|
93
|
-
If you installed WordPressCS using either of the above commands, you can upgrade to a newer version as follows:
|
|
94
|
-
```bash
|
|
95
|
-
# Project local install
|
|
96
|
-
composer update wp-coding-standards/wpcs --with-dependencies
|
|
97
|
-
|
|
98
|
-
# Global install
|
|
99
|
-
composer global update wp-coding-standards/wpcs --with-dependencies
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Using your WordPressCS install
|
|
103
|
-
|
|
104
|
-
Once you have installed WordPressCS using either of the above commands, use it as follows:
|
|
105
|
-
```bash
|
|
106
|
-
# Project local install
|
|
107
|
-
vendor/bin/phpcs -ps . --standard=WordPress
|
|
108
|
-
|
|
109
|
-
# Global install
|
|
110
|
-
%USER_DIRECTORY%/Composer/vendor/bin/phpcs -ps . --standard=WordPress
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
> **Pro-tip**: For the convenience of using `phpcs` as a global command, use the _Global install_ method and add the path to the `%USER_DIRECTORY%/Composer/vendor/bin` directory to the `PATH` environment variable for your operating system.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
## Rulesets
|
|
117
|
-
|
|
118
|
-
### Standards subsets
|
|
119
|
-
|
|
120
|
-
The project encompasses a super-set of the sniffs that the WordPress community may need. If you use the `WordPress` standard you will get all the checks.
|
|
121
|
-
|
|
122
|
-
You can use the following as standard names when invoking `phpcs` to select sniffs, fitting your needs:
|
|
123
|
-
|
|
124
|
-
* `WordPress` - complete set with all of the sniffs in the project
|
|
125
|
-
- `WordPress-Core` - main ruleset for [WordPress core coding standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/)
|
|
126
|
-
- `WordPress-Docs` - additional ruleset for [WordPress inline documentation standards](https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/)
|
|
127
|
-
- `WordPress-Extra` - extended ruleset with recommended best practices, not sufficiently covered in the WordPress core coding standards
|
|
128
|
-
- includes `WordPress-Core`
|
|
129
|
-
|
|
130
|
-
### Using a custom ruleset
|
|
131
|
-
|
|
132
|
-
If you need to further customize the selection of sniffs for your project - you can create a custom ruleset file.
|
|
133
|
-
|
|
134
|
-
When you name this file either `.phpcs.xml`, `phpcs.xml`, `.phpcs.xml.dist` or `phpcs.xml.dist`, PHP_CodeSniffer will automatically locate it as long as it is placed in the directory from which you run the CodeSniffer or in a directory above it. If you follow these naming conventions you don't have to supply a `--standard` CLI argument.
|
|
135
|
-
|
|
136
|
-
For more info, read about [using a default configuration file](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file). See also the provided WordPressCS [`phpcs.xml.dist.sample`](phpcs.xml.dist.sample) file and the [fully annotated example ruleset](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-ruleset.xml) in the PHP_CodeSniffer documentation.
|
|
137
|
-
|
|
138
|
-
### Customizing sniff behaviour
|
|
139
|
-
|
|
140
|
-
The WordPress Coding Standard contains a number of sniffs which are configurable. This means that you can turn parts of the sniff on or off, or change the behaviour by setting a property for the sniff in your custom `[.]phpcs.xml[.dist]` file.
|
|
141
|
-
|
|
142
|
-
You can find a complete list of all the properties you can change for the WordPressCS sniffs in the [wiki](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties).
|
|
143
|
-
|
|
144
|
-
WordPressCS also uses sniffs from PHPCSExtra and from PHP_CodeSniffer itself.
|
|
145
|
-
The [README for PHPCSExtra](https://github.com/PHPCSStandards/PHPCSExtra) contains information on the properties which can be set for the sniff from PHPCSExtra.
|
|
146
|
-
Information on custom properties which can be set for sniffs from PHP_CodeSniffer can be found in the [PHP_CodeSniffer wiki](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties).
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
### Recommended additional rulesets
|
|
150
|
-
|
|
151
|
-
#### PHPCompatibility
|
|
152
|
-
|
|
153
|
-
The [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) ruleset and its subset [PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP) come highly recommended.
|
|
154
|
-
The [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) sniffs are designed to analyse your code for cross-version PHP compatibility.
|
|
155
|
-
|
|
156
|
-
The [PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP) ruleset is based on PHPCompatibility, but specifically crafted to prevent false positives for projects which expect to run within the context of WordPress, i.e. core, plugins and themes.
|
|
157
|
-
|
|
158
|
-
Install either as a separate ruleset and run it separately against your code or add it to your custom ruleset, like so:
|
|
159
|
-
```xml
|
|
160
|
-
<config name="testVersion" value="7.0-"/>
|
|
161
|
-
<rule ref="PHPCompatibilityWP">
|
|
162
|
-
<include-pattern>*\.php$</include-pattern>
|
|
163
|
-
</rule>
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Whichever way you run it, do make sure you set the `testVersion` to run the sniffs against. The `testVersion` determines for which PHP versions you will receive compatibility information. The recommended setting for this at this moment is `7.0-` to support the same PHP versions as WordPress Core supports.
|
|
167
|
-
|
|
168
|
-
For more information about setting the `testVersion`, see:
|
|
169
|
-
* [PHPCompatibility: Sniffing your code for compatibility with specific PHP version(s)](https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions)
|
|
170
|
-
* [PHPCompatibility: Using a custom ruleset](https://github.com/PHPCompatibility/PHPCompatibility#using-a-custom-ruleset)
|
|
171
|
-
|
|
172
|
-
#### VariableAnalysis
|
|
173
|
-
|
|
174
|
-
For some additional checks around (undefined/unused) variables, the [`VariableAnalysis`](https://github.com/sirbrillig/phpcs-variable-analysis/) standard is a handy addition.
|
|
175
|
-
|
|
176
|
-
#### VIP Coding Standards
|
|
177
|
-
|
|
178
|
-
For those projects which deploy to the WordPress VIP platform, it is recommended to also use the [official WordPress VIP coding standards](https://github.com/Automattic/VIP-Coding-Standards) ruleset.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
## How to use
|
|
182
|
-
|
|
183
|
-
### Command line
|
|
184
|
-
|
|
185
|
-
Run the `phpcs` command line tool on a given file or directory, for example:
|
|
186
|
-
```bash
|
|
187
|
-
vendor/bin/phpcs --standard=WordPress wp-load.php
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Will result in following output:
|
|
191
|
-
```
|
|
192
|
-
--------------------------------------------------------------------------------
|
|
193
|
-
FOUND 6 ERRORS AND 4 WARNINGS AFFECTING 5 LINES
|
|
194
|
-
--------------------------------------------------------------------------------
|
|
195
|
-
36 | WARNING | error_reporting() can lead to full path disclosure.
|
|
196
|
-
36 | WARNING | error_reporting() found. Changing configuration values at
|
|
197
|
-
| | runtime is strongly discouraged.
|
|
198
|
-
52 | WARNING | Silencing errors is strongly discouraged. Use proper error
|
|
199
|
-
| | checking instead. Found: @file_exists( dirname(...
|
|
200
|
-
52 | WARNING | Silencing errors is strongly discouraged. Use proper error
|
|
201
|
-
| | checking instead. Found: @file_exists( dirname(...
|
|
202
|
-
75 | ERROR | Overriding WordPress globals is prohibited. Found assignment
|
|
203
|
-
| | to $path
|
|
204
|
-
78 | ERROR | Detected usage of a possibly undefined superglobal array
|
|
205
|
-
| | index: $_SERVER['REQUEST_URI']. Use isset() or empty() to
|
|
206
|
-
| | check the index exists before using it
|
|
207
|
-
78 | ERROR | $_SERVER['REQUEST_URI'] not unslashed before sanitization. Use
|
|
208
|
-
| | wp_unslash() or similar
|
|
209
|
-
78 | ERROR | Detected usage of a non-sanitized input variable:
|
|
210
|
-
| | $_SERVER['REQUEST_URI']
|
|
211
|
-
104 | ERROR | All output should be run through an escaping function (see the
|
|
212
|
-
| | Security sections in the WordPress Developer Handbooks), found
|
|
213
|
-
| | '$die'.
|
|
214
|
-
104 | ERROR | All output should be run through an escaping function (see the
|
|
215
|
-
| | Security sections in the WordPress Developer Handbooks), found
|
|
216
|
-
| | '__'.
|
|
217
|
-
--------------------------------------------------------------------------------
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### Using PHPCS and WordPressCS from within your IDE
|
|
221
|
-
|
|
222
|
-
The [wiki](https://github.com/WordPress/WordPress-Coding-Standards/wiki) contains links to various in- and external tutorials about setting up WordPressCS to work in your IDE.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
## Running your code through WordPressCS automatically using Continuous Integration tools
|
|
226
|
-
|
|
227
|
-
- [Running in GitHub Actions](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Running-in-GitHub-Actions)
|
|
228
|
-
- [Running in Travis](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Running-in-Travis)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
## Fixing errors or ignoring them
|
|
232
|
-
|
|
233
|
-
You can find information on how to deal with some of the more frequent issues in the [wiki](https://github.com/WordPress/WordPress-Coding-Standards/wiki).
|
|
234
|
-
|
|
235
|
-
### Tools shipped with WordPressCS
|
|
236
|
-
|
|
237
|
-
Since version 1.2.0, WordPressCS has a special sniff category `Utils`.
|
|
238
|
-
|
|
239
|
-
This sniff category contains some tools which, generally speaking, will only be needed to be run once over a codebase and for which the fixers can be considered _risky_, i.e. very careful review by a developer is needed before accepting the fixes made by these sniffs.
|
|
240
|
-
|
|
241
|
-
The sniffs in this category are disabled by default and can only be activated by adding some properties for each sniff via a custom ruleset.
|
|
242
|
-
|
|
243
|
-
At this moment, WordPressCS offer the following tools:
|
|
244
|
-
* `WordPress.Utils.I18nTextDomainFixer` - This sniff can replace the text domain used in a code-base.
|
|
245
|
-
The sniff will fix the text domains in both I18n function calls as well as in a plugin/theme header.
|
|
246
|
-
Passing the following properties will activate the sniff:
|
|
247
|
-
- `old_text_domain`: an array with one or more (old) text domain names which need to be replaced;
|
|
248
|
-
- `new_text_domain`: the correct (new) text domain as a string.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
## Contributing
|
|
252
|
-
|
|
253
|
-
See [CONTRIBUTING](.github/CONTRIBUTING.md), including information about [unit testing](.github/CONTRIBUTING.md#unit-testing) the standard.
|
|
254
|
-
|
|
255
|
-
## Funding
|
|
256
|
-
|
|
257
|
-
If you want to sponsor the work on WordPressCS, you can do so by donating to the [PHP_CodeSniffer Open Collective](https://opencollective.com/php_codesniffer).
|
|
258
|
-
|
|
259
|
-
## License
|
|
260
|
-
|
|
261
|
-
See [LICENSE](LICENSE) (MIT).
|
package/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php
DELETED
|
@@ -1,261 +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;
|
|
11
|
-
|
|
12
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
13
|
-
use PHPCSUtils\BackCompat\BCFile;
|
|
14
|
-
use PHPCSUtils\Utils\GetTokensAsString;
|
|
15
|
-
use PHPCSUtils\Utils\MessageHelper;
|
|
16
|
-
use PHPCSUtils\Utils\TextStrings;
|
|
17
|
-
use WordPressCS\WordPress\Helpers\RulesetPropertyHelper;
|
|
18
|
-
use WordPressCS\WordPress\Sniff;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Restricts array assignment of certain keys.
|
|
22
|
-
*
|
|
23
|
-
* @since 0.3.0
|
|
24
|
-
* @since 0.10.0 Class became a proper abstract class. This was already the behaviour.
|
|
25
|
-
* Moved the file and renamed the class from
|
|
26
|
-
* `\WordPressCS\WordPress\Sniffs\Arrays\ArrayAssignmentRestrictionsSniff` to
|
|
27
|
-
* `\WordPressCS\WordPress\AbstractArrayAssignmentRestrictionsSniff`.
|
|
28
|
-
*/
|
|
29
|
-
abstract class AbstractArrayAssignmentRestrictionsSniff extends Sniff {
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Exclude groups.
|
|
33
|
-
*
|
|
34
|
-
* Example: 'foo,bar'
|
|
35
|
-
*
|
|
36
|
-
* @since 0.3.0
|
|
37
|
-
* @since 1.0.0 This property now expects to be passed an array.
|
|
38
|
-
* Previously a comma-delimited string was expected.
|
|
39
|
-
*
|
|
40
|
-
* @var string[]
|
|
41
|
-
*/
|
|
42
|
-
public $exclude = array();
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Groups of variable data to check against.
|
|
46
|
-
* Don't use this in extended classes, override getGroups() instead.
|
|
47
|
-
* This is only used for Unit tests.
|
|
48
|
-
*
|
|
49
|
-
* @var array<string, array>
|
|
50
|
-
*/
|
|
51
|
-
public static $groups = array();
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Cache for the excluded groups information.
|
|
55
|
-
*
|
|
56
|
-
* @since 0.11.0
|
|
57
|
-
*
|
|
58
|
-
* @var array<string, bool>
|
|
59
|
-
*/
|
|
60
|
-
protected $excluded_groups = array();
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Cache for the group information.
|
|
64
|
-
*
|
|
65
|
-
* @since 0.13.0
|
|
66
|
-
*
|
|
67
|
-
* @var array<string, array>
|
|
68
|
-
*/
|
|
69
|
-
protected $groups_cache = array();
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Returns an array of tokens this test wants to listen for.
|
|
73
|
-
*
|
|
74
|
-
* @return array
|
|
75
|
-
*/
|
|
76
|
-
public function register() {
|
|
77
|
-
// Retrieve the groups only once and don't set up a listener if there are no groups.
|
|
78
|
-
if ( false === $this->setup_groups() ) {
|
|
79
|
-
return array();
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return array(
|
|
83
|
-
\T_DOUBLE_ARROW,
|
|
84
|
-
\T_CLOSE_SQUARE_BRACKET,
|
|
85
|
-
\T_CONSTANT_ENCAPSED_STRING,
|
|
86
|
-
\T_DOUBLE_QUOTED_STRING,
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Groups of variables to restrict.
|
|
92
|
-
*
|
|
93
|
-
* This method should be overridden in extending classes.
|
|
94
|
-
*
|
|
95
|
-
* Example: groups => array(
|
|
96
|
-
* 'groupname' => array(
|
|
97
|
-
* 'type' => 'error' | 'warning',
|
|
98
|
-
* 'message' => 'Descriptive error message. The error message will be passed the $key and $val of the current array assignment.',
|
|
99
|
-
* 'keys' => array( 'key1', 'another_key' ),
|
|
100
|
-
* )
|
|
101
|
-
* )
|
|
102
|
-
*
|
|
103
|
-
* @return array<string, array>
|
|
104
|
-
*/
|
|
105
|
-
abstract public function getGroups();
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Cache the groups.
|
|
109
|
-
*
|
|
110
|
-
* @since 0.13.0
|
|
111
|
-
*
|
|
112
|
-
* @return bool True if the groups were setup. False if not.
|
|
113
|
-
*/
|
|
114
|
-
protected function setup_groups() {
|
|
115
|
-
$this->groups_cache = $this->getGroups();
|
|
116
|
-
|
|
117
|
-
if ( empty( $this->groups_cache ) && empty( self::$groups ) ) {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Allow for adding extra unit tests.
|
|
122
|
-
if ( ! empty( self::$groups ) ) {
|
|
123
|
-
$this->groups_cache = array_merge( $this->groups_cache, self::$groups );
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return true;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Processes this test, when one of its tokens is encountered.
|
|
131
|
-
*
|
|
132
|
-
* @param int $stackPtr The position of the current token in the stack.
|
|
133
|
-
*
|
|
134
|
-
* @return void
|
|
135
|
-
*/
|
|
136
|
-
public function process_token( $stackPtr ) {
|
|
137
|
-
|
|
138
|
-
$this->excluded_groups = RulesetPropertyHelper::merge_custom_array( $this->exclude );
|
|
139
|
-
if ( array_diff_key( $this->groups_cache, $this->excluded_groups ) === array() ) {
|
|
140
|
-
// All groups have been excluded.
|
|
141
|
-
// Don't remove the listener as the exclude property can be changed inline.
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
$token = $this->tokens[ $stackPtr ];
|
|
146
|
-
|
|
147
|
-
if ( \T_CLOSE_SQUARE_BRACKET === $token['code'] ) {
|
|
148
|
-
$equalPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true );
|
|
149
|
-
if ( \T_EQUAL !== $this->tokens[ $equalPtr ]['code']
|
|
150
|
-
&& \T_COALESCE_EQUAL !== $this->tokens[ $equalPtr ]['code']
|
|
151
|
-
) {
|
|
152
|
-
// This is not an assignment. Bow out.
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Instances: Multi-dimensional array.
|
|
158
|
-
$inst = array();
|
|
159
|
-
|
|
160
|
-
/*
|
|
161
|
-
* Covers array assignments:
|
|
162
|
-
* `$foo = array( 'bar' => 'taz' );`
|
|
163
|
-
* `$foo['bar'] = $taz;`
|
|
164
|
-
*/
|
|
165
|
-
if ( \T_CLOSE_SQUARE_BRACKET === $token['code'] || \T_DOUBLE_ARROW === $token['code'] ) {
|
|
166
|
-
$operator = $stackPtr; // T_DOUBLE_ARROW.
|
|
167
|
-
if ( \T_CLOSE_SQUARE_BRACKET === $token['code'] ) {
|
|
168
|
-
$operator = $equalPtr;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
$keyIdx = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true );
|
|
172
|
-
if ( isset( Tokens::$stringTokens[ $this->tokens[ $keyIdx ]['code'] ] )
|
|
173
|
-
&& ! is_numeric( $this->tokens[ $keyIdx ]['content'] )
|
|
174
|
-
) {
|
|
175
|
-
$key = TextStrings::stripQuotes( $this->tokens[ $keyIdx ]['content'] );
|
|
176
|
-
$valStart = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $operator + 1 ), null, true );
|
|
177
|
-
$valEnd = BCFile::findEndOfStatement( $this->phpcsFile, $valStart, \T_COLON );
|
|
178
|
-
if ( \T_COMMA === $this->tokens[ $valEnd ]['code']
|
|
179
|
-
|| \T_SEMICOLON === $this->tokens[ $valEnd ]['code']
|
|
180
|
-
) {
|
|
181
|
-
// FindEndOfStatement includes the comma/semi-colon if that's the end of the statement.
|
|
182
|
-
// That's not what we want (and inconsistent), so remove it.
|
|
183
|
-
--$valEnd;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
$val = trim( GetTokensAsString::compact( $this->phpcsFile, $valStart, $valEnd, true ) );
|
|
187
|
-
$inst[ $key ] = array(
|
|
188
|
-
'value' => $val,
|
|
189
|
-
'line' => $token['line'],
|
|
190
|
-
'keyptr' => $keyIdx,
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
} elseif ( isset( Tokens::$stringTokens[ $token['code'] ] ) ) {
|
|
194
|
-
/*
|
|
195
|
-
* Covers assignments via query parameters: `$foo = 'bar=taz&other=thing';`.
|
|
196
|
-
*/
|
|
197
|
-
if ( preg_match_all( '#(?:^|&)([a-z_]+)=([^&]*)#i', TextStrings::stripQuotes( $token['content'] ), $matches ) <= 0 ) {
|
|
198
|
-
return; // No assignments here, nothing to check.
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
foreach ( $matches[1] as $match_nr => $key ) {
|
|
202
|
-
$inst[ $key ] = array(
|
|
203
|
-
'value' => $matches[2][ $match_nr ],
|
|
204
|
-
'line' => $token['line'],
|
|
205
|
-
'keyptr' => $stackPtr,
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
if ( empty( $inst ) ) {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
foreach ( $this->groups_cache as $groupName => $group ) {
|
|
215
|
-
|
|
216
|
-
if ( isset( $this->excluded_groups[ $groupName ] ) ) {
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
foreach ( $inst as $key => $assignment ) {
|
|
221
|
-
if ( ! \in_array( $key, $group['keys'], true ) ) {
|
|
222
|
-
continue;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
$output = \call_user_func( array( $this, 'callback' ), $key, $assignment['value'], $assignment['line'], $group );
|
|
226
|
-
|
|
227
|
-
if ( ! isset( $output ) || false === $output ) {
|
|
228
|
-
continue;
|
|
229
|
-
} elseif ( true === $output ) {
|
|
230
|
-
$message = $group['message'];
|
|
231
|
-
} else {
|
|
232
|
-
$message = $output;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
MessageHelper::addMessage(
|
|
236
|
-
$this->phpcsFile,
|
|
237
|
-
$message,
|
|
238
|
-
$assignment['keyptr'],
|
|
239
|
-
( 'error' === $group['type'] ),
|
|
240
|
-
MessageHelper::stringToErrorcode( $groupName . '_' . $key ),
|
|
241
|
-
array( $key, $assignment['value'] )
|
|
242
|
-
);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Callback to process each confirmed key, to check value.
|
|
249
|
-
*
|
|
250
|
-
* This method must be extended to add the logic to check assignment value.
|
|
251
|
-
*
|
|
252
|
-
* @param string $key Array index / key.
|
|
253
|
-
* @param mixed $val Assigned value.
|
|
254
|
-
* @param int $line Token line.
|
|
255
|
-
* @param array $group Group definition.
|
|
256
|
-
*
|
|
257
|
-
* @return mixed FALSE if no match, TRUE if matches, STRING if matches
|
|
258
|
-
* with custom error message passed to ->process().
|
|
259
|
-
*/
|
|
260
|
-
abstract public function callback( $key, $val, $line, $group );
|
|
261
|
-
}
|