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,289 +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\NamingConventions;
|
|
11
|
-
|
|
12
|
-
use PHP_CodeSniffer\Files\File;
|
|
13
|
-
use PHP_CodeSniffer\Sniffs\AbstractVariableSniff as PHPCS_AbstractVariableSniff;
|
|
14
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
15
|
-
use PHPCSUtils\Utils\Scopes;
|
|
16
|
-
use PHPCSUtils\Utils\TextStrings;
|
|
17
|
-
use PHPCSUtils\Utils\Variables;
|
|
18
|
-
use WordPressCS\WordPress\Helpers\ContextHelper;
|
|
19
|
-
use WordPressCS\WordPress\Helpers\RulesetPropertyHelper;
|
|
20
|
-
use WordPressCS\WordPress\Helpers\SnakeCaseHelper;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Checks the naming of variables and member variables.
|
|
24
|
-
*
|
|
25
|
-
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#naming-conventions
|
|
26
|
-
*
|
|
27
|
-
* @since 0.9.0
|
|
28
|
-
* @since 0.13.0 Class name changed: this class is now namespaced.
|
|
29
|
-
* @since 2.0.0 Now offers name suggestions for variables in violation.
|
|
30
|
-
*
|
|
31
|
-
* Last synced with base class January 2022 at commit 4b49a952bf0e2c3863d0a113256bae0d7fe63d52.
|
|
32
|
-
* @link https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php
|
|
33
|
-
*/
|
|
34
|
-
final class ValidVariableNameSniff extends PHPCS_AbstractVariableSniff {
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Mixed-case variables used by WordPress.
|
|
38
|
-
*
|
|
39
|
-
* @since 0.11.0
|
|
40
|
-
*
|
|
41
|
-
* @var array
|
|
42
|
-
*/
|
|
43
|
-
protected $wordpress_mixed_case_vars = array(
|
|
44
|
-
'EZSQL_ERROR' => true,
|
|
45
|
-
'GETID3_ERRORARRAY' => true,
|
|
46
|
-
'is_IE' => true,
|
|
47
|
-
'is_IIS' => true,
|
|
48
|
-
'is_macIE' => true,
|
|
49
|
-
'is_NS4' => true,
|
|
50
|
-
'is_winIE' => true,
|
|
51
|
-
'PHP_SELF' => true,
|
|
52
|
-
'post_ID' => true,
|
|
53
|
-
'tag_ID' => true,
|
|
54
|
-
'user_ID' => true,
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* List of member variables that can have mixed case.
|
|
59
|
-
*
|
|
60
|
-
* @since 0.9.0
|
|
61
|
-
* @since 0.11.0 Changed from public to protected.
|
|
62
|
-
* @since 3.0.0 Renamed from `$whitelisted_mixed_case_member_var_names` to `$allowed_mixed_case_member_var_names`.
|
|
63
|
-
*
|
|
64
|
-
* @var array
|
|
65
|
-
*/
|
|
66
|
-
protected $allowed_mixed_case_member_var_names = array(
|
|
67
|
-
'cat_ID' => true,
|
|
68
|
-
'comment_ID' => true,
|
|
69
|
-
'comment_author_IP' => true,
|
|
70
|
-
'comment_post_ID' => true,
|
|
71
|
-
'ID' => true,
|
|
72
|
-
'post_ID' => true,
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Custom list of properties which can have mixed case.
|
|
77
|
-
*
|
|
78
|
-
* @since 0.11.0
|
|
79
|
-
* @since 3.0.0 Renamed from `$customPropertiesWhitelist` to `$allowed_custom_properties`.
|
|
80
|
-
*
|
|
81
|
-
* @var string[]
|
|
82
|
-
*/
|
|
83
|
-
public $allowed_custom_properties = array();
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Cache of previously added custom functions.
|
|
87
|
-
*
|
|
88
|
-
* Prevents having to do the same merges over and over again.
|
|
89
|
-
*
|
|
90
|
-
* @since 0.10.0
|
|
91
|
-
* @since 0.11.0 - Name changed from $addedCustomVariables.
|
|
92
|
-
* - Changed the format from simple bool to array.
|
|
93
|
-
*
|
|
94
|
-
* @var array
|
|
95
|
-
*/
|
|
96
|
-
protected $addedCustomProperties = array(
|
|
97
|
-
'properties' => null,
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Processes this test, when one of its tokens is encountered.
|
|
102
|
-
*
|
|
103
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
104
|
-
* @param int $stackPtr The position of the current token in the
|
|
105
|
-
* stack passed in $tokens.
|
|
106
|
-
*
|
|
107
|
-
* @return void
|
|
108
|
-
*/
|
|
109
|
-
protected function processVariable( File $phpcsFile, $stackPtr ) {
|
|
110
|
-
$tokens = $phpcsFile->getTokens();
|
|
111
|
-
|
|
112
|
-
// If it's a php reserved var, then its ok.
|
|
113
|
-
if ( Variables::isPHPReservedVarName( $tokens[ $stackPtr ]['content'] ) ) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Merge any custom variables with the defaults.
|
|
118
|
-
$this->merge_allow_lists();
|
|
119
|
-
|
|
120
|
-
$var_name = ltrim( $tokens[ $stackPtr ]['content'], '$' );
|
|
121
|
-
|
|
122
|
-
// Likewise if it is a mixed-case var used by WordPress core.
|
|
123
|
-
if ( isset( $this->wordpress_mixed_case_vars[ $var_name ] ) ) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
$obj_operator = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true );
|
|
128
|
-
if ( \T_OBJECT_OPERATOR === $tokens[ $obj_operator ]['code']
|
|
129
|
-
|| \T_NULLSAFE_OBJECT_OPERATOR === $tokens[ $obj_operator ]['code']
|
|
130
|
-
) {
|
|
131
|
-
// Check to see if we are using a variable from an object.
|
|
132
|
-
$var = $phpcsFile->findNext( Tokens::$emptyTokens, ( $obj_operator + 1 ), null, true );
|
|
133
|
-
if ( \T_STRING === $tokens[ $var ]['code'] ) {
|
|
134
|
-
$bracket = $phpcsFile->findNext( Tokens::$emptyTokens, ( $var + 1 ), null, true );
|
|
135
|
-
if ( \T_OPEN_PARENTHESIS !== $tokens[ $bracket ]['code'] ) {
|
|
136
|
-
$obj_var_name = $tokens[ $var ]['content'];
|
|
137
|
-
|
|
138
|
-
if ( isset( $this->allowed_mixed_case_member_var_names[ $obj_var_name ] ) ) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
$suggested_name = SnakeCaseHelper::get_suggestion( $obj_var_name );
|
|
143
|
-
if ( $suggested_name !== $obj_var_name ) {
|
|
144
|
-
$error = 'Object property "$%s" is not in valid snake_case format, try "$%s"';
|
|
145
|
-
$data = array(
|
|
146
|
-
$obj_var_name,
|
|
147
|
-
$suggested_name,
|
|
148
|
-
);
|
|
149
|
-
$phpcsFile->addError( $error, $var, 'UsedPropertyNotSnakeCase', $data );
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
$in_class = false;
|
|
156
|
-
if ( ContextHelper::has_object_operator_before( $phpcsFile, $stackPtr ) === true ) {
|
|
157
|
-
// The variable lives within a class, and is referenced like
|
|
158
|
-
// this: MyClass::$_variable or $class->variable.
|
|
159
|
-
$in_class = true;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
$suggested_name = SnakeCaseHelper::get_suggestion( $var_name );
|
|
163
|
-
if ( $suggested_name !== $var_name ) {
|
|
164
|
-
if ( $in_class && ! isset( $this->allowed_mixed_case_member_var_names[ $var_name ] ) ) {
|
|
165
|
-
$error = 'Object property "$%s" is not in valid snake_case format, try "$%s"';
|
|
166
|
-
$error_name = 'UsedPropertyNotSnakeCase';
|
|
167
|
-
} elseif ( ! $in_class ) {
|
|
168
|
-
$error = 'Variable "$%s" is not in valid snake_case format, try "$%s"';
|
|
169
|
-
$error_name = 'VariableNotSnakeCase';
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if ( isset( $error, $error_name ) ) {
|
|
173
|
-
$data = array(
|
|
174
|
-
$var_name,
|
|
175
|
-
$suggested_name,
|
|
176
|
-
);
|
|
177
|
-
$phpcsFile->addError( $error, $stackPtr, $error_name, $data );
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Processes class member variables.
|
|
184
|
-
*
|
|
185
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
186
|
-
* @param int $stackPtr The position of the current token in the
|
|
187
|
-
* stack passed in $tokens.
|
|
188
|
-
*
|
|
189
|
-
* @return void
|
|
190
|
-
*/
|
|
191
|
-
protected function processMemberVar( File $phpcsFile, $stackPtr ) {
|
|
192
|
-
// Make sure this is actually an OO property and not an OO method parameter or illegal property declaration.
|
|
193
|
-
if ( Scopes::isOOProperty( $phpcsFile, $stackPtr ) === false ) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Merge any custom variables with the defaults.
|
|
198
|
-
$this->merge_allow_lists();
|
|
199
|
-
|
|
200
|
-
$tokens = $phpcsFile->getTokens();
|
|
201
|
-
$var_name = ltrim( $tokens[ $stackPtr ]['content'], '$' );
|
|
202
|
-
|
|
203
|
-
if ( isset( $this->allowed_mixed_case_member_var_names[ $var_name ] ) ) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
$suggested_name = SnakeCaseHelper::get_suggestion( $var_name );
|
|
208
|
-
if ( $suggested_name !== $var_name ) {
|
|
209
|
-
$error = 'Member variable "$%s" is not in valid snake_case format, try "$%s"';
|
|
210
|
-
$data = array(
|
|
211
|
-
$var_name,
|
|
212
|
-
$suggested_name,
|
|
213
|
-
);
|
|
214
|
-
$phpcsFile->addError( $error, $stackPtr, 'PropertyNotSnakeCase', $data );
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Processes the variables found within a double quoted string.
|
|
220
|
-
*
|
|
221
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
222
|
-
* @param int $stackPtr The position of the double quoted
|
|
223
|
-
* string.
|
|
224
|
-
*
|
|
225
|
-
* @return void
|
|
226
|
-
*/
|
|
227
|
-
protected function processVariableInString( File $phpcsFile, $stackPtr ) {
|
|
228
|
-
$tokens = $phpcsFile->getTokens();
|
|
229
|
-
|
|
230
|
-
// There will always be embeds if the processVariableInString() was called.
|
|
231
|
-
$embeds = TextStrings::getEmbeds( $tokens[ $stackPtr ]['content'] );
|
|
232
|
-
|
|
233
|
-
// Merge any custom variables with the defaults.
|
|
234
|
-
$this->merge_allow_lists();
|
|
235
|
-
|
|
236
|
-
foreach ( $embeds as $embed ) {
|
|
237
|
-
// Grab any variables contained in the embed.
|
|
238
|
-
if ( preg_match_all( '`\$(\{)?(?<name>[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)(?(1)\})`', $embed, $matches ) === 0 ) {
|
|
239
|
-
continue;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
foreach ( $matches['name'] as $var_name ) {
|
|
243
|
-
// If it's a php reserved var, then its ok.
|
|
244
|
-
if ( Variables::isPHPReservedVarName( $var_name ) ) {
|
|
245
|
-
continue;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// Likewise if it is a mixed-case var used by WordPress core.
|
|
249
|
-
if ( isset( $this->wordpress_mixed_case_vars[ $var_name ] ) ) {
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
$suggested_name = SnakeCaseHelper::get_suggestion( $var_name );
|
|
254
|
-
if ( $suggested_name !== $var_name ) {
|
|
255
|
-
$error = 'Variable "$%s" is not in valid snake_case format, try "$%s"';
|
|
256
|
-
$data = array(
|
|
257
|
-
$var_name,
|
|
258
|
-
$suggested_name,
|
|
259
|
-
);
|
|
260
|
-
$phpcsFile->addError( $error, $stackPtr, 'InterpolatedVariableNotSnakeCase', $data );
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Merge a custom allow list provided via a custom ruleset with the predefined allow list,
|
|
268
|
-
* if we haven't already.
|
|
269
|
-
*
|
|
270
|
-
* @since 0.10.0
|
|
271
|
-
* @since 2.0.0 Removed unused $phpcs_file parameter.
|
|
272
|
-
* @since 3.0.0 Renamed from `mergeWhiteList()` to `merge_allow_lists()`.
|
|
273
|
-
*
|
|
274
|
-
* @return void
|
|
275
|
-
*/
|
|
276
|
-
protected function merge_allow_lists() {
|
|
277
|
-
if ( $this->allowed_custom_properties !== $this->addedCustomProperties['properties'] ) {
|
|
278
|
-
// Fix property potentially passed as comma-delimited string.
|
|
279
|
-
$customProperties = RulesetPropertyHelper::merge_custom_array( $this->allowed_custom_properties, array(), false );
|
|
280
|
-
|
|
281
|
-
$this->allowed_mixed_case_member_var_names = RulesetPropertyHelper::merge_custom_array(
|
|
282
|
-
$customProperties,
|
|
283
|
-
$this->allowed_mixed_case_member_var_names
|
|
284
|
-
);
|
|
285
|
-
|
|
286
|
-
$this->addedCustomProperties['properties'] = $this->allowed_custom_properties;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
@@ -1,63 +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
|
-
* Restrict the use of various development functions.
|
|
16
|
-
*
|
|
17
|
-
* @since 0.11.0
|
|
18
|
-
* @since 0.13.0 Class name changed: this class is now namespaced.
|
|
19
|
-
*/
|
|
20
|
-
final class DevelopmentFunctionsSniff extends AbstractFunctionRestrictionsSniff {
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Groups of functions to restrict.
|
|
24
|
-
*
|
|
25
|
-
* Example: groups => array(
|
|
26
|
-
* 'lambda' => array(
|
|
27
|
-
* 'type' => 'error' | 'warning',
|
|
28
|
-
* 'message' => 'Use anonymous functions instead please!',
|
|
29
|
-
* 'functions' => array( 'file_get_contents', 'create_function' ),
|
|
30
|
-
* )
|
|
31
|
-
* )
|
|
32
|
-
*
|
|
33
|
-
* @return array
|
|
34
|
-
*/
|
|
35
|
-
public function getGroups() {
|
|
36
|
-
return array(
|
|
37
|
-
'error_log' => array(
|
|
38
|
-
'type' => 'warning',
|
|
39
|
-
'message' => '%s() found. Debug code should not normally be used in production.',
|
|
40
|
-
'functions' => array(
|
|
41
|
-
'error_log',
|
|
42
|
-
'var_dump',
|
|
43
|
-
'var_export',
|
|
44
|
-
'print_r',
|
|
45
|
-
'trigger_error',
|
|
46
|
-
'set_error_handler',
|
|
47
|
-
'debug_backtrace',
|
|
48
|
-
'debug_print_backtrace',
|
|
49
|
-
'wp_debug_backtrace_summary',
|
|
50
|
-
),
|
|
51
|
-
),
|
|
52
|
-
|
|
53
|
-
'prevent_path_disclosure' => array(
|
|
54
|
-
'type' => 'warning',
|
|
55
|
-
'message' => '%s() can lead to full path disclosure.',
|
|
56
|
-
'functions' => array(
|
|
57
|
-
'error_reporting',
|
|
58
|
-
'phpinfo',
|
|
59
|
-
),
|
|
60
|
-
),
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
}
|
package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php
DELETED
|
@@ -1,100 +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
|
-
* Discourages the use of various native PHP functions and suggests alternatives.
|
|
16
|
-
*
|
|
17
|
-
* @since 0.11.0
|
|
18
|
-
* @since 0.13.0 Class name changed: this class is now namespaced.
|
|
19
|
-
* @since 0.14.0 `create_function` was moved to the PHP.RestrictedFunctions sniff.
|
|
20
|
-
*/
|
|
21
|
-
final class DiscouragedPHPFunctionsSniff extends AbstractFunctionRestrictionsSniff {
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Groups of functions to discourage.
|
|
25
|
-
*
|
|
26
|
-
* Example: groups => array(
|
|
27
|
-
* 'lambda' => array(
|
|
28
|
-
* 'type' => 'error' | 'warning',
|
|
29
|
-
* 'message' => 'Use anonymous functions instead please!',
|
|
30
|
-
* 'functions' => array( 'file_get_contents', 'create_function' ),
|
|
31
|
-
* )
|
|
32
|
-
* )
|
|
33
|
-
*
|
|
34
|
-
* @return array
|
|
35
|
-
*/
|
|
36
|
-
public function getGroups() {
|
|
37
|
-
return array(
|
|
38
|
-
'serialize' => array(
|
|
39
|
-
'type' => 'warning',
|
|
40
|
-
'message' => '%s() found. Serialized data has known vulnerability problems with Object Injection. JSON is generally a better approach for serializing data. See https://www.owasp.org/index.php/PHP_Object_Injection',
|
|
41
|
-
'functions' => array(
|
|
42
|
-
'serialize',
|
|
43
|
-
'unserialize',
|
|
44
|
-
),
|
|
45
|
-
),
|
|
46
|
-
|
|
47
|
-
'urlencode' => array(
|
|
48
|
-
'type' => 'warning',
|
|
49
|
-
'message' => '%s() should only be used when dealing with legacy applications rawurlencode() should now be used instead. See https://www.php.net/function.rawurlencode and http://www.faqs.org/rfcs/rfc3986.html',
|
|
50
|
-
'functions' => array(
|
|
51
|
-
'urlencode',
|
|
52
|
-
),
|
|
53
|
-
),
|
|
54
|
-
|
|
55
|
-
'runtime_configuration' => array(
|
|
56
|
-
'type' => 'warning',
|
|
57
|
-
'message' => '%s() found. Changing configuration values at runtime is strongly discouraged.',
|
|
58
|
-
'functions' => array(
|
|
59
|
-
'error_reporting',
|
|
60
|
-
'ini_restore',
|
|
61
|
-
'apache_setenv',
|
|
62
|
-
'putenv',
|
|
63
|
-
'set_include_path',
|
|
64
|
-
'restore_include_path',
|
|
65
|
-
// This alias was DEPRECATED in PHP 5.3.0, and REMOVED as of PHP 7.0.0.
|
|
66
|
-
'magic_quotes_runtime',
|
|
67
|
-
// Warning This function was DEPRECATED in PHP 5.3.0, and REMOVED as of PHP 7.0.0.
|
|
68
|
-
'set_magic_quotes_runtime',
|
|
69
|
-
// Warning This function was removed from most SAPIs in PHP 5.3.0, and was removed from PHP-FPM in PHP 7.0.0.
|
|
70
|
-
'dl',
|
|
71
|
-
),
|
|
72
|
-
),
|
|
73
|
-
|
|
74
|
-
'system_calls' => array(
|
|
75
|
-
'type' => 'warning',
|
|
76
|
-
'message' => '%s() found. PHP system calls are often disabled by server admins.',
|
|
77
|
-
'functions' => array(
|
|
78
|
-
'exec',
|
|
79
|
-
'passthru',
|
|
80
|
-
'proc_open',
|
|
81
|
-
'shell_exec',
|
|
82
|
-
'system',
|
|
83
|
-
'popen',
|
|
84
|
-
),
|
|
85
|
-
),
|
|
86
|
-
|
|
87
|
-
'obfuscation' => array(
|
|
88
|
-
'type' => 'warning',
|
|
89
|
-
'message' => '%s() can be used to obfuscate code which is strongly discouraged. Please verify that the function is used for benign reasons.',
|
|
90
|
-
'functions' => array(
|
|
91
|
-
'base64_decode',
|
|
92
|
-
'base64_encode',
|
|
93
|
-
'convert_uudecode',
|
|
94
|
-
'convert_uuencode',
|
|
95
|
-
'str_rot13',
|
|
96
|
-
),
|
|
97
|
-
),
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
@@ -1,52 +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
|
-
* Restricts the usage of extract().
|
|
16
|
-
*
|
|
17
|
-
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#dont-extract
|
|
18
|
-
*
|
|
19
|
-
* @since 0.10.0 Previously this check was contained within the
|
|
20
|
-
* `WordPress.VIP.RestrictedFunctions` sniff.
|
|
21
|
-
* @since 0.13.0 Class name changed: this class is now namespaced.
|
|
22
|
-
* @since 1.0.0 This sniff has been moved from the `Functions` category to the `PHP` category.
|
|
23
|
-
*/
|
|
24
|
-
final class DontExtractSniff extends AbstractFunctionRestrictionsSniff {
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Groups of functions to restrict.
|
|
28
|
-
*
|
|
29
|
-
* Example: groups => array(
|
|
30
|
-
* 'lambda' => array(
|
|
31
|
-
* 'type' => 'error' | 'warning',
|
|
32
|
-
* 'message' => 'Use anonymous functions instead please!',
|
|
33
|
-
* 'functions' => array( 'file_get_contents', 'create_function' ),
|
|
34
|
-
* )
|
|
35
|
-
* )
|
|
36
|
-
*
|
|
37
|
-
* @return array
|
|
38
|
-
*/
|
|
39
|
-
public function getGroups() {
|
|
40
|
-
return array(
|
|
41
|
-
|
|
42
|
-
'extract' => array(
|
|
43
|
-
'type' => 'error',
|
|
44
|
-
'message' => '%s() usage is highly discouraged, due to the complexity and unintended issues it might cause.',
|
|
45
|
-
'functions' => array(
|
|
46
|
-
'extract',
|
|
47
|
-
),
|
|
48
|
-
),
|
|
49
|
-
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,193 +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\MessageHelper;
|
|
13
|
-
use PHPCSUtils\Utils\PassedParameters;
|
|
14
|
-
use PHPCSUtils\Utils\TextStrings;
|
|
15
|
-
use WordPressCS\WordPress\AbstractFunctionParameterSniff;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Detect use of the `ini_set()` function.
|
|
19
|
-
*
|
|
20
|
-
* - Won't throw notices for "safe" ini directives as listed in the safe-list.
|
|
21
|
-
* - Throws errors for ini directives listed in the disallow-list.
|
|
22
|
-
* - A warning will be thrown in all other cases.
|
|
23
|
-
*
|
|
24
|
-
* @since 2.1.0
|
|
25
|
-
*/
|
|
26
|
-
final class IniSetSniff extends AbstractFunctionParameterSniff {
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Array of functions that must be checked.
|
|
30
|
-
*
|
|
31
|
-
* @since 2.1.0
|
|
32
|
-
*
|
|
33
|
-
* @var array Multidimensional array with parameter details.
|
|
34
|
-
* $target_functions = array(
|
|
35
|
-
* (string) Function name.
|
|
36
|
-
* );
|
|
37
|
-
*/
|
|
38
|
-
protected $target_functions = array(
|
|
39
|
-
'ini_set' => true,
|
|
40
|
-
'ini_alter' => true, // Alias function name.
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Array of PHP configuration options that are safe to be manipulated, as changing
|
|
45
|
-
* the value of these, won't cause interoperability issues between WP/plugins/themes.
|
|
46
|
-
*
|
|
47
|
-
* @since 2.1.0
|
|
48
|
-
* @since 3.0.0 Renamed from `$whitelisted_options` to `$safe_options`.
|
|
49
|
-
*
|
|
50
|
-
* @var array Multidimensional array with parameter details.
|
|
51
|
-
* $safe_options = array(
|
|
52
|
-
* (string) option name. = array(
|
|
53
|
-
* (string[]) 'valid_values' = array()
|
|
54
|
-
* )
|
|
55
|
-
* );
|
|
56
|
-
*/
|
|
57
|
-
protected $safe_options = array(
|
|
58
|
-
'auto_detect_line_endings' => array(),
|
|
59
|
-
'highlight.bg' => array(),
|
|
60
|
-
'highlight.comment' => array(),
|
|
61
|
-
'highlight.default' => array(),
|
|
62
|
-
'highlight.html' => array(),
|
|
63
|
-
'highlight.keyword' => array(),
|
|
64
|
-
'highlight.string' => array(),
|
|
65
|
-
'short_open_tag' => array(
|
|
66
|
-
'valid_values' => array( 'true', '1', 'on' ),
|
|
67
|
-
),
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Array of PHP configuration options that are not allowed to be manipulated, as changing
|
|
72
|
-
* the value of these, will be problematic for interoperability between WP/plugins/themes.
|
|
73
|
-
*
|
|
74
|
-
* @since 2.1.0
|
|
75
|
-
* @since 3.0.0 Renamed from `$blacklisted_options` to `$disallowed_options`.
|
|
76
|
-
*
|
|
77
|
-
* @var array Multidimensional array with parameter details.
|
|
78
|
-
* $disallowed_options = array(
|
|
79
|
-
* (string) option name. = array(
|
|
80
|
-
* (string[]) 'invalid_values' = array()
|
|
81
|
-
* (string) 'message'
|
|
82
|
-
* )
|
|
83
|
-
* );
|
|
84
|
-
*/
|
|
85
|
-
protected $disallowed_options = array(
|
|
86
|
-
'bcmath.scale' => array(
|
|
87
|
-
'message' => 'Use `bcscale()` instead.',
|
|
88
|
-
),
|
|
89
|
-
'display_errors' => array(
|
|
90
|
-
'message' => 'Use `WP_DEBUG_DISPLAY` instead.',
|
|
91
|
-
),
|
|
92
|
-
'error_reporting' => array(
|
|
93
|
-
'message' => 'Use `WP_DEBUG` instead.',
|
|
94
|
-
),
|
|
95
|
-
'filter.default' => array(
|
|
96
|
-
'message' => 'Changing the option value can break other plugins. Use the filter flag constants when calling the Filter functions instead.',
|
|
97
|
-
),
|
|
98
|
-
'filter.default_flags' => array(
|
|
99
|
-
'message' => 'Changing the option value can break other plugins. Use the filter flag constants when calling the Filter functions instead.',
|
|
100
|
-
),
|
|
101
|
-
'iconv.input_encoding' => array(
|
|
102
|
-
'message' => 'This option is not supported since PHP 5.6 - use `iconv_set_encoding()` instead.',
|
|
103
|
-
),
|
|
104
|
-
'iconv.internal_encoding' => array(
|
|
105
|
-
'message' => 'This option is not supported since PHP 5.6 - use `iconv_set_encoding()` instead.',
|
|
106
|
-
),
|
|
107
|
-
'iconv.output_encoding' => array(
|
|
108
|
-
'message' => 'This option is not supported since PHP 5.6 - use `iconv_set_encoding()` instead.',
|
|
109
|
-
),
|
|
110
|
-
'ignore_user_abort' => array(
|
|
111
|
-
'message' => 'Use `ignore_user_abort()` instead.',
|
|
112
|
-
),
|
|
113
|
-
'log_errors' => array(
|
|
114
|
-
'message' => 'Use `WP_DEBUG_LOG` instead.',
|
|
115
|
-
),
|
|
116
|
-
'max_execution_time' => array(
|
|
117
|
-
'message' => 'Use `set_time_limit()` instead.',
|
|
118
|
-
),
|
|
119
|
-
'memory_limit' => array(
|
|
120
|
-
'message' => 'Use `wp_raise_memory_limit()` or hook into the filters in that function.',
|
|
121
|
-
),
|
|
122
|
-
'short_open_tag' => array(
|
|
123
|
-
'invalid_values' => array( 'false', '0', 'off' ),
|
|
124
|
-
'message' => 'Turning off short_open_tag is prohibited as it can break other plugins.',
|
|
125
|
-
),
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Process the parameter of a matched function.
|
|
130
|
-
*
|
|
131
|
-
* Errors if an option is found in the disallow-list. Warns as
|
|
132
|
-
* 'risky' when the option is not found in the safe-list.
|
|
133
|
-
*
|
|
134
|
-
* @since 2.1.0
|
|
135
|
-
*
|
|
136
|
-
* @param int $stackPtr The position of the current token in the stack.
|
|
137
|
-
* @param string $group_name The name of the group which was matched.
|
|
138
|
-
* @param string $matched_content The token content (function name) which was matched
|
|
139
|
-
* in lowercase.
|
|
140
|
-
* @param array $parameters Array with information about the parameters.
|
|
141
|
-
*
|
|
142
|
-
* @return void
|
|
143
|
-
*/
|
|
144
|
-
public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) {
|
|
145
|
-
$option_param = PassedParameters::getParameterFromStack( $parameters, 1, 'option' );
|
|
146
|
-
$value_param = PassedParameters::getParameterFromStack( $parameters, 2, 'value' );
|
|
147
|
-
|
|
148
|
-
if ( false === $option_param || false === $value_param ) {
|
|
149
|
-
// Missing required param. Not the concern of this sniff. Bow out.
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
$option_name = TextStrings::stripQuotes( $option_param['clean'] );
|
|
154
|
-
$option_value = TextStrings::stripQuotes( $value_param['clean'] );
|
|
155
|
-
if ( isset( $this->safe_options[ $option_name ] ) ) {
|
|
156
|
-
$safe_option = $this->safe_options[ $option_name ];
|
|
157
|
-
if ( empty( $safe_option['valid_values'] ) || in_array( strtolower( $option_value ), $safe_option['valid_values'], true ) ) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if ( isset( $this->disallowed_options[ $option_name ] ) ) {
|
|
163
|
-
$disallowed_option = $this->disallowed_options[ $option_name ];
|
|
164
|
-
if ( empty( $disallowed_option['invalid_values'] )
|
|
165
|
-
|| in_array( strtolower( $option_value ), $disallowed_option['invalid_values'], true )
|
|
166
|
-
) {
|
|
167
|
-
$this->phpcsFile->addError(
|
|
168
|
-
'Found: %s(%s, %s). %s',
|
|
169
|
-
$stackPtr,
|
|
170
|
-
MessageHelper::stringToErrorcode( $option_name . '_Disallowed' ),
|
|
171
|
-
array(
|
|
172
|
-
$matched_content,
|
|
173
|
-
$option_param['clean'],
|
|
174
|
-
$value_param['clean'],
|
|
175
|
-
$disallowed_option['message'],
|
|
176
|
-
)
|
|
177
|
-
);
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
$this->phpcsFile->addWarning(
|
|
183
|
-
'Changing configuration values at runtime is strongly discouraged. Found: %s(%s, %s)',
|
|
184
|
-
$stackPtr,
|
|
185
|
-
'Risky',
|
|
186
|
-
array(
|
|
187
|
-
$matched_content,
|
|
188
|
-
$option_param['clean'],
|
|
189
|
-
$value_param['clean'],
|
|
190
|
-
)
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
}
|