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
package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* PHPCSExtra, a collection of sniffs and standards for use with PHP_CodeSniffer.
|
|
4
|
-
*
|
|
5
|
-
* @package PHPCSExtra
|
|
6
|
-
* @copyright 2023 PHPCSExtra Contributors
|
|
7
|
-
* @license https://opensource.org/licenses/LGPL-3.0 LGPL3
|
|
8
|
-
* @link https://github.com/PHPCSStandards/PHPCSExtra
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
namespace PHPCSExtra\Universal\Sniffs\CodeAnalysis;
|
|
12
|
-
|
|
13
|
-
use PHP_CodeSniffer\Files\File;
|
|
14
|
-
use PHP_CodeSniffer\Sniffs\Sniff;
|
|
15
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Detects use of `echo [v]sprintf();.
|
|
19
|
-
*
|
|
20
|
-
* @link https://www.php.net/manual/en/function.printf.php
|
|
21
|
-
* @link https://www.php.net/manual/en/function.sprintf.php
|
|
22
|
-
* @link https://www.php.net/manual/en/function.vprintf.php
|
|
23
|
-
* @link https://www.php.net/manual/en/function.vsprintf.php
|
|
24
|
-
*
|
|
25
|
-
* @since 1.1.0
|
|
26
|
-
*/
|
|
27
|
-
final class NoEchoSprintfSniff implements Sniff
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Functions to look for with their replacements.
|
|
32
|
-
*
|
|
33
|
-
* @since 1.1.0
|
|
34
|
-
*
|
|
35
|
-
* @var array<string, string>
|
|
36
|
-
*/
|
|
37
|
-
private $targetFunctions = [
|
|
38
|
-
'sprintf' => 'printf',
|
|
39
|
-
'vsprintf' => 'vprintf',
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Returns an array of tokens this test wants to listen for.
|
|
44
|
-
*
|
|
45
|
-
* @since 1.1.0
|
|
46
|
-
*
|
|
47
|
-
* @return array<int|string>
|
|
48
|
-
*/
|
|
49
|
-
public function register()
|
|
50
|
-
{
|
|
51
|
-
return [\T_ECHO];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Processes this test, when one of its tokens is encountered.
|
|
56
|
-
*
|
|
57
|
-
* @since 1.1.0
|
|
58
|
-
*
|
|
59
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
60
|
-
* @param int $stackPtr The position of the current token
|
|
61
|
-
* in the stack passed in $tokens.
|
|
62
|
-
*
|
|
63
|
-
* @return void
|
|
64
|
-
*/
|
|
65
|
-
public function process(File $phpcsFile, $stackPtr)
|
|
66
|
-
{
|
|
67
|
-
$tokens = $phpcsFile->getTokens();
|
|
68
|
-
|
|
69
|
-
$skip = Tokens::$emptyTokens;
|
|
70
|
-
$skip[] = \T_NS_SEPARATOR;
|
|
71
|
-
|
|
72
|
-
$next = $phpcsFile->findNext($skip, ($stackPtr + 1), null, true);
|
|
73
|
-
if ($next === false
|
|
74
|
-
|| $tokens[$next]['code'] !== \T_STRING
|
|
75
|
-
|| isset($this->targetFunctions[\strtolower($tokens[$next]['content'])]) === false
|
|
76
|
-
) {
|
|
77
|
-
// Not our target.
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
$detectedFunction = \strtolower($tokens[$next]['content']);
|
|
82
|
-
|
|
83
|
-
$openParens = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true);
|
|
84
|
-
if ($openParens === false
|
|
85
|
-
|| $tokens[$openParens]['code'] !== \T_OPEN_PARENTHESIS
|
|
86
|
-
|| isset($tokens[$openParens]['parenthesis_closer']) === false
|
|
87
|
-
) {
|
|
88
|
-
// Live coding/parse error.
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
$closeParens = $tokens[$openParens]['parenthesis_closer'];
|
|
93
|
-
$afterFunctionCall = $phpcsFile->findNext(Tokens::$emptyTokens, ($closeParens + 1), null, true);
|
|
94
|
-
if ($afterFunctionCall === false
|
|
95
|
-
|| ($tokens[$afterFunctionCall]['code'] !== \T_SEMICOLON
|
|
96
|
-
&& $tokens[$afterFunctionCall]['code'] !== \T_CLOSE_TAG)
|
|
97
|
-
) {
|
|
98
|
-
// Live coding/parse error or compound echo statement.
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
$fix = $phpcsFile->addFixableError(
|
|
103
|
-
'Unnecessary "echo %s(...)" found. Use "%s(...)" instead.',
|
|
104
|
-
$next,
|
|
105
|
-
'Found',
|
|
106
|
-
[
|
|
107
|
-
$tokens[$next]['content'],
|
|
108
|
-
$this->targetFunctions[$detectedFunction],
|
|
109
|
-
]
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
if ($fix === true) {
|
|
113
|
-
$phpcsFile->fixer->beginChangeset();
|
|
114
|
-
|
|
115
|
-
// Remove echo and whitespace.
|
|
116
|
-
$phpcsFile->fixer->replaceToken($stackPtr, '');
|
|
117
|
-
|
|
118
|
-
for ($i = ($stackPtr + 1); $i < $next; $i++) {
|
|
119
|
-
if ($tokens[$i]['code'] !== \T_WHITESPACE) {
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
$phpcsFile->fixer->replaceToken($i, '');
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
$phpcsFile->fixer->replaceToken($next, $this->targetFunctions[$detectedFunction]);
|
|
127
|
-
|
|
128
|
-
$phpcsFile->fixer->endChangeset();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* PHPCSExtra, a collection of sniffs and standards for use with PHP_CodeSniffer.
|
|
4
|
-
*
|
|
5
|
-
* @package PHPCSExtra
|
|
6
|
-
* @copyright 2020 PHPCSExtra Contributors
|
|
7
|
-
* @license https://opensource.org/licenses/LGPL-3.0 LGPL3
|
|
8
|
-
* @link https://github.com/PHPCSStandards/PHPCSExtra
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
namespace PHPCSExtra\Universal\Sniffs\CodeAnalysis;
|
|
12
|
-
|
|
13
|
-
use PHP_CodeSniffer\Files\File;
|
|
14
|
-
use PHP_CodeSniffer\Sniffs\Sniff;
|
|
15
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
16
|
-
use PHPCSUtils\Utils\Conditions;
|
|
17
|
-
use PHPCSUtils\Utils\FunctionDeclarations;
|
|
18
|
-
use PHPCSUtils\Utils\GetTokensAsString;
|
|
19
|
-
use PHPCSUtils\Utils\ObjectDeclarations;
|
|
20
|
-
use PHPCSUtils\Utils\Scopes;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Forbid the use of the `static` keyword for late static binding in OO constructs which are final.
|
|
24
|
-
*
|
|
25
|
-
* @since 1.0.0
|
|
26
|
-
*/
|
|
27
|
-
final class StaticInFinalClassSniff implements Sniff
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* OO Scopes in which late static binding is useless.
|
|
32
|
-
*
|
|
33
|
-
* @var array<int|string>
|
|
34
|
-
*/
|
|
35
|
-
private $validOOScopes = [
|
|
36
|
-
\T_CLASS, // Only if final.
|
|
37
|
-
\T_ANON_CLASS, // Final by nature.
|
|
38
|
-
\T_ENUM, // Final by design.
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Returns an array of tokens this test wants to listen for.
|
|
43
|
-
*
|
|
44
|
-
* @since 1.0.0
|
|
45
|
-
*
|
|
46
|
-
* @return array<int|string>
|
|
47
|
-
*/
|
|
48
|
-
public function register()
|
|
49
|
-
{
|
|
50
|
-
return [
|
|
51
|
-
// These tokens are used to retrieve return types reliably.
|
|
52
|
-
\T_FUNCTION,
|
|
53
|
-
\T_FN,
|
|
54
|
-
// While this is our "real" target.
|
|
55
|
-
\T_STATIC,
|
|
56
|
-
// But we also need this as after "instanceof", `static` is tokenized as `T_STRING in PHPCS < 4.0.0.
|
|
57
|
-
// See: https://github.com/squizlabs/PHP_CodeSniffer/pull/3121
|
|
58
|
-
\T_STRING,
|
|
59
|
-
];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Processes this test, when one of its tokens is encountered.
|
|
64
|
-
*
|
|
65
|
-
* @since 1.0.0
|
|
66
|
-
*
|
|
67
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
68
|
-
* @param int $stackPtr The position of the current token
|
|
69
|
-
* in the stack passed in $tokens.
|
|
70
|
-
*
|
|
71
|
-
* @return int|void Integer stack pointer to skip forward or void to continue
|
|
72
|
-
* normal file processing.
|
|
73
|
-
*/
|
|
74
|
-
public function process(File $phpcsFile, $stackPtr)
|
|
75
|
-
{
|
|
76
|
-
$tokens = $phpcsFile->getTokens();
|
|
77
|
-
|
|
78
|
-
if ($tokens[$stackPtr]['code'] === \T_STRING
|
|
79
|
-
&& \strtolower($tokens[$stackPtr]['content']) !== 'static'
|
|
80
|
-
) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if ($tokens[$stackPtr]['code'] === \T_FUNCTION
|
|
85
|
-
|| $tokens[$stackPtr]['code'] === \T_FN
|
|
86
|
-
) {
|
|
87
|
-
/*
|
|
88
|
-
* Check return types for methods in final classes, anon classes and enums.
|
|
89
|
-
*
|
|
90
|
-
* Will return the scope opener of the function to prevent potential duplicate notifications.
|
|
91
|
-
*/
|
|
92
|
-
$scopeOpener = $stackPtr;
|
|
93
|
-
if (isset($tokens[$stackPtr]['scope_opener']) === true) {
|
|
94
|
-
$scopeOpener = $tokens[$stackPtr]['scope_opener'];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if ($tokens[$stackPtr]['code'] === \T_FUNCTION) {
|
|
98
|
-
$ooPtr = Scopes::validDirectScope($phpcsFile, $stackPtr, $this->validOOScopes);
|
|
99
|
-
if ($ooPtr === false) {
|
|
100
|
-
// Method in a trait (not known where it is used), interface (never final) or not in an OO scope.
|
|
101
|
-
return $scopeOpener;
|
|
102
|
-
}
|
|
103
|
-
} else {
|
|
104
|
-
$ooPtr = Conditions::getLastCondition($phpcsFile, $stackPtr, $this->validOOScopes);
|
|
105
|
-
if ($ooPtr === false) {
|
|
106
|
-
// Arrow function outside of OO.
|
|
107
|
-
return $scopeOpener;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if ($tokens[$ooPtr]['code'] === \T_CLASS) {
|
|
112
|
-
$classProps = ObjectDeclarations::getClassProperties($phpcsFile, $ooPtr);
|
|
113
|
-
if ($classProps['is_final'] === false) {
|
|
114
|
-
// Method in a non-final class.
|
|
115
|
-
return $scopeOpener;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
$functionProps = FunctionDeclarations::getProperties($phpcsFile, $stackPtr);
|
|
120
|
-
if ($functionProps['return_type'] === '') {
|
|
121
|
-
return $scopeOpener;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
$staticPtr = $phpcsFile->findNext(
|
|
125
|
-
\T_STATIC,
|
|
126
|
-
$functionProps['return_type_token'],
|
|
127
|
-
($functionProps['return_type_end_token'] + 1)
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
if ($staticPtr === false) {
|
|
131
|
-
return $scopeOpener;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Found a return type containing the `static` type.
|
|
135
|
-
$this->handleError($phpcsFile, $staticPtr, 'ReturnType', '"static" return type');
|
|
136
|
-
|
|
137
|
-
return $scopeOpener;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/*
|
|
141
|
-
* Check other uses of static.
|
|
142
|
-
*/
|
|
143
|
-
$functionPtr = Conditions::getLastCondition($phpcsFile, $stackPtr, [\T_FUNCTION, \T_CLOSURE]);
|
|
144
|
-
if ($functionPtr === false || $tokens[$functionPtr]['code'] === \T_CLOSURE) {
|
|
145
|
-
/*
|
|
146
|
-
* When `false`, this code is absolutely invalid, but not something to be addressed via this sniff.
|
|
147
|
-
* When a closure, we're not interested in it. The closure class is final, but closures
|
|
148
|
-
* can be bound to other classes. This needs further research and should maybe get its own sniff.
|
|
149
|
-
*/
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
$ooPtr = Scopes::validDirectScope($phpcsFile, $functionPtr, $this->validOOScopes);
|
|
154
|
-
if ($ooPtr === false) {
|
|
155
|
-
// Not in an OO context.
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if ($tokens[$ooPtr]['code'] === \T_CLASS) {
|
|
160
|
-
$classProps = ObjectDeclarations::getClassProperties($phpcsFile, $ooPtr);
|
|
161
|
-
if ($classProps['is_final'] === false) {
|
|
162
|
-
// Token in a non-final class.
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
$prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);
|
|
168
|
-
if ($prevNonEmpty !== false) {
|
|
169
|
-
if ($tokens[$prevNonEmpty]['code'] === \T_INSTANCEOF) {
|
|
170
|
-
$prevPrevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true);
|
|
171
|
-
$extraMsg = GetTokensAsString::compact($phpcsFile, $prevPrevNonEmpty, $stackPtr, true);
|
|
172
|
-
$this->handleError($phpcsFile, $stackPtr, 'InstanceOf', '"' . $extraMsg . '"');
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if ($tokens[$prevNonEmpty]['code'] === \T_NEW) {
|
|
177
|
-
$this->handleError($phpcsFile, $stackPtr, 'NewInstance', '"new static"');
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
$nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
|
|
183
|
-
if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === \T_DOUBLE_COLON) {
|
|
184
|
-
$nextNextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true);
|
|
185
|
-
$extraMsg = GetTokensAsString::compact($phpcsFile, $stackPtr, $nextNextNonEmpty, true);
|
|
186
|
-
$this->handleError($phpcsFile, $stackPtr, 'ScopeResolution', '"' . $extraMsg . '"');
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Throw and potentially fix the error.
|
|
193
|
-
*
|
|
194
|
-
* @since 1.0.0
|
|
195
|
-
*
|
|
196
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
197
|
-
* @param int $stackPtr The position of erroneous `T_STATIC` token.
|
|
198
|
-
* @param string $errorCode The error code for the message.
|
|
199
|
-
* @param string $extraMsg Addition to the error message.
|
|
200
|
-
*
|
|
201
|
-
* @return void
|
|
202
|
-
*/
|
|
203
|
-
private function handleError($phpcsFile, $stackPtr, $errorCode, $extraMsg)
|
|
204
|
-
{
|
|
205
|
-
$fix = $phpcsFile->addFixableError(
|
|
206
|
-
'Use "self" instead of "static" when using late static binding in a final OO construct. Found: %s',
|
|
207
|
-
$stackPtr,
|
|
208
|
-
$errorCode,
|
|
209
|
-
[$extraMsg]
|
|
210
|
-
);
|
|
211
|
-
|
|
212
|
-
if ($fix === true) {
|
|
213
|
-
$phpcsFile->fixer->replaceToken($stackPtr, 'self');
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* PHPCSExtra, a collection of sniffs and standards for use with PHP_CodeSniffer.
|
|
4
|
-
*
|
|
5
|
-
* @package PHPCSExtra
|
|
6
|
-
* @copyright 2020 PHPCSExtra Contributors
|
|
7
|
-
* @license https://opensource.org/licenses/LGPL-3.0 LGPL3
|
|
8
|
-
* @link https://github.com/PHPCSStandards/PHPCSExtra
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
namespace PHPCSExtra\Universal\Sniffs\Constants;
|
|
12
|
-
|
|
13
|
-
use PHP_CodeSniffer\Files\File;
|
|
14
|
-
use PHP_CodeSniffer\Sniffs\Sniff;
|
|
15
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Verifies that the "::class" keyword when used for class name resolution is in lowercase.
|
|
19
|
-
*
|
|
20
|
-
* @link https://www.php.net/manual/en/language.constants.predefined.php
|
|
21
|
-
* @link https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class
|
|
22
|
-
*
|
|
23
|
-
* @since 1.0.0
|
|
24
|
-
*/
|
|
25
|
-
final class LowercaseClassResolutionKeywordSniff implements Sniff
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Name of the metric.
|
|
30
|
-
*
|
|
31
|
-
* @since 1.0.0
|
|
32
|
-
*
|
|
33
|
-
* @var string
|
|
34
|
-
*/
|
|
35
|
-
const METRIC_NAME = 'Magic ::class constant case';
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Returns an array of tokens this test wants to listen for.
|
|
39
|
-
*
|
|
40
|
-
* @since 1.0.0
|
|
41
|
-
*
|
|
42
|
-
* @return array<int|string>
|
|
43
|
-
*/
|
|
44
|
-
public function register()
|
|
45
|
-
{
|
|
46
|
-
return [\T_STRING];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Processes this test, when one of its tokens is encountered.
|
|
51
|
-
*
|
|
52
|
-
* @since 1.0.0
|
|
53
|
-
*
|
|
54
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
55
|
-
* @param int $stackPtr The position of the current token
|
|
56
|
-
* in the stack passed in $tokens.
|
|
57
|
-
*
|
|
58
|
-
* @return void
|
|
59
|
-
*/
|
|
60
|
-
public function process(File $phpcsFile, $stackPtr)
|
|
61
|
-
{
|
|
62
|
-
$tokens = $phpcsFile->getTokens();
|
|
63
|
-
$content = $tokens[$stackPtr]['content'];
|
|
64
|
-
$contentLC = \strtolower($content);
|
|
65
|
-
|
|
66
|
-
if ($contentLC !== 'class') {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
$nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
|
|
71
|
-
if ($nextToken !== false && $tokens[$nextToken]['code'] === \T_OPEN_PARENTHESIS) {
|
|
72
|
-
// Function call or declaration for a function called "class".
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
$prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);
|
|
77
|
-
if ($prevToken === false || $tokens[$prevToken]['code'] !== \T_DOUBLE_COLON) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if ($contentLC === $content) {
|
|
82
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'lowercase');
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
$error = "The ::class keyword for class name resolution must be in lowercase. Expected: '::%s'; found: '::%s'";
|
|
87
|
-
$data = [
|
|
88
|
-
$contentLC,
|
|
89
|
-
$content,
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
$errorCode = '';
|
|
93
|
-
if (\strtoupper($content) === $content) {
|
|
94
|
-
$errorCode = 'Uppercase';
|
|
95
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'uppercase');
|
|
96
|
-
} else {
|
|
97
|
-
$errorCode = 'Mixedcase';
|
|
98
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'mixed case');
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
$fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data);
|
|
102
|
-
if ($fix === true) {
|
|
103
|
-
$phpcsFile->fixer->replaceToken($stackPtr, $contentLC);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* PHPCSExtra, a collection of sniffs and standards for use with PHP_CodeSniffer.
|
|
4
|
-
*
|
|
5
|
-
* @package PHPCSExtra
|
|
6
|
-
* @copyright 2022 PHPCSExtra Contributors
|
|
7
|
-
* @license https://opensource.org/licenses/LGPL-3.0 LGPL3
|
|
8
|
-
* @link https://github.com/PHPCSStandards/PHPCSExtra
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
namespace PHPCSExtra\Universal\Sniffs\Constants;
|
|
12
|
-
|
|
13
|
-
use PHP_CodeSniffer\Files\File;
|
|
14
|
-
use PHP_CodeSniffer\Sniffs\Sniff;
|
|
15
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
16
|
-
use PHPCSUtils\Tokens\Collections;
|
|
17
|
-
use PHPCSUtils\Utils\Scopes;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Standardize the modifier keyword order for OO constant declarations.
|
|
21
|
-
*
|
|
22
|
-
* @since 1.0.0
|
|
23
|
-
*/
|
|
24
|
-
final class ModifierKeywordOrderSniff implements Sniff
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Name of the metric.
|
|
29
|
-
*
|
|
30
|
-
* @since 1.0.0
|
|
31
|
-
*
|
|
32
|
-
* @var string
|
|
33
|
-
*/
|
|
34
|
-
const METRIC_NAME = 'OO constant modifier keyword order';
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Order preference: final visibility.
|
|
38
|
-
*
|
|
39
|
-
* @since 1.0.0
|
|
40
|
-
*
|
|
41
|
-
* @var string
|
|
42
|
-
*/
|
|
43
|
-
const FINAL_VISIBILITY = 'final visibility';
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Order preference: visibility final.
|
|
47
|
-
*
|
|
48
|
-
* @since 1.0.0
|
|
49
|
-
*
|
|
50
|
-
* @var string
|
|
51
|
-
*/
|
|
52
|
-
const VISIBILITY_FINAL = 'visibility final';
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Preferred order for the modifier keywords.
|
|
56
|
-
*
|
|
57
|
-
* Accepted values:
|
|
58
|
-
* - "final visibility".
|
|
59
|
-
* - or "visibility final".
|
|
60
|
-
*
|
|
61
|
-
* Defaults to "final visibility".
|
|
62
|
-
*
|
|
63
|
-
* @since 1.0.0
|
|
64
|
-
*
|
|
65
|
-
* @var string
|
|
66
|
-
*/
|
|
67
|
-
public $order = self::FINAL_VISIBILITY;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Returns an array of tokens this test wants to listen for.
|
|
71
|
-
*
|
|
72
|
-
* @since 1.0.0
|
|
73
|
-
*
|
|
74
|
-
* @return array<int|string>
|
|
75
|
-
*/
|
|
76
|
-
public function register()
|
|
77
|
-
{
|
|
78
|
-
return [\T_CONST];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Processes this test, when one of its tokens is encountered.
|
|
83
|
-
*
|
|
84
|
-
* @since 1.0.0
|
|
85
|
-
*
|
|
86
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
87
|
-
* @param int $stackPtr The position of the current token
|
|
88
|
-
* in the stack passed in $tokens.
|
|
89
|
-
*
|
|
90
|
-
* @return void
|
|
91
|
-
*/
|
|
92
|
-
public function process(File $phpcsFile, $stackPtr)
|
|
93
|
-
{
|
|
94
|
-
if (Scopes::isOOConstant($phpcsFile, $stackPtr) === false) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
$tokens = $phpcsFile->getTokens();
|
|
99
|
-
$valid = Collections::constantModifierKeywords() + Tokens::$emptyTokens;
|
|
100
|
-
|
|
101
|
-
$finalPtr = false;
|
|
102
|
-
$visibilityPtr = false;
|
|
103
|
-
|
|
104
|
-
for ($i = ($stackPtr - 1); $i > 0; $i--) {
|
|
105
|
-
if (isset($valid[$tokens[$i]['code']]) === false) {
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) {
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if ($tokens[$i]['code'] === \T_FINAL) {
|
|
114
|
-
$finalPtr = $i;
|
|
115
|
-
} else {
|
|
116
|
-
$visibilityPtr = $i;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if ($finalPtr === false || $visibilityPtr === false) {
|
|
121
|
-
/*
|
|
122
|
-
* Either no modifier keywords found at all; or only one type of modifier
|
|
123
|
-
* keyword (final or visibility) declared, but not both. No ordering needed.
|
|
124
|
-
*/
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if ($visibilityPtr < $finalPtr) {
|
|
129
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::VISIBILITY_FINAL);
|
|
130
|
-
} else {
|
|
131
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::FINAL_VISIBILITY);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
$message = 'OO constant modifier keywords are not in the correct order. Expected: "%s", found: "%s"';
|
|
135
|
-
|
|
136
|
-
switch ($this->order) {
|
|
137
|
-
case self::VISIBILITY_FINAL:
|
|
138
|
-
if ($visibilityPtr < $finalPtr) {
|
|
139
|
-
// Order is correct. Nothing to do.
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
$this->handleError($phpcsFile, $finalPtr, $visibilityPtr);
|
|
144
|
-
break;
|
|
145
|
-
|
|
146
|
-
case self::FINAL_VISIBILITY:
|
|
147
|
-
default:
|
|
148
|
-
if ($finalPtr < $visibilityPtr) {
|
|
149
|
-
// Order is correct. Nothing to do.
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
$this->handleError($phpcsFile, $visibilityPtr, $finalPtr);
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Throw the error and potentially fix it.
|
|
160
|
-
*
|
|
161
|
-
* @since 1.0.0
|
|
162
|
-
*
|
|
163
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
164
|
-
* @param int $firstKeyword The position of the first keyword found.
|
|
165
|
-
* @param int $secondKeyword The position of the second keyword token.
|
|
166
|
-
*
|
|
167
|
-
* @return void
|
|
168
|
-
*/
|
|
169
|
-
private function handleError(File $phpcsFile, $firstKeyword, $secondKeyword)
|
|
170
|
-
{
|
|
171
|
-
$tokens = $phpcsFile->getTokens();
|
|
172
|
-
|
|
173
|
-
$message = 'Constant modifier keywords are not in the correct order. Expected: "%s", found: "%s"';
|
|
174
|
-
$data = [
|
|
175
|
-
$tokens[$secondKeyword]['content'] . ' ' . $tokens[$firstKeyword]['content'],
|
|
176
|
-
$tokens[$firstKeyword]['content'] . ' ' . $tokens[$secondKeyword]['content'],
|
|
177
|
-
];
|
|
178
|
-
|
|
179
|
-
$fix = $phpcsFile->addFixableError($message, $firstKeyword, 'Incorrect', $data);
|
|
180
|
-
|
|
181
|
-
if ($fix === true) {
|
|
182
|
-
$phpcsFile->fixer->beginChangeset();
|
|
183
|
-
|
|
184
|
-
$phpcsFile->fixer->replaceToken($secondKeyword, '');
|
|
185
|
-
|
|
186
|
-
// Prevent leaving behind trailing whitespace.
|
|
187
|
-
$i = ($secondKeyword + 1);
|
|
188
|
-
while ($tokens[$i]['code'] === \T_WHITESPACE) {
|
|
189
|
-
$phpcsFile->fixer->replaceToken($i, '');
|
|
190
|
-
++$i;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// Use the original token content as the case used for keywords is not the concern of this sniff.
|
|
194
|
-
$phpcsFile->fixer->addContentBefore($firstKeyword, $tokens[$secondKeyword]['content'] . ' ');
|
|
195
|
-
|
|
196
|
-
$phpcsFile->fixer->endChangeset();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|