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,275 +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\OOStructures;
|
|
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\ObjectDeclarations;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Verifies that the interface names used in a class/enum "implements" statement or an interface "extends" statement,
|
|
21
|
-
* are listed in alphabetic order.
|
|
22
|
-
*
|
|
23
|
-
* @since 1.0.0
|
|
24
|
-
*/
|
|
25
|
-
final class AlphabeticExtendsImplementsSniff implements Sniff
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Name of the "Alphabetically ordered" metric.
|
|
30
|
-
*
|
|
31
|
-
* @since 1.0.0
|
|
32
|
-
*
|
|
33
|
-
* @var string
|
|
34
|
-
*/
|
|
35
|
-
const METRIC_NAME_ALPHA = 'Interface names in implements/extends ordered alphabetically (%s)';
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Name of the "interface count" metric.
|
|
39
|
-
*
|
|
40
|
-
* @since 1.0.0
|
|
41
|
-
*
|
|
42
|
-
* @var string
|
|
43
|
-
*/
|
|
44
|
-
const METRIC_NAME_COUNT = 'Number of interfaces being implemented/extended';
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* The sort order to use for the statement.
|
|
48
|
-
*
|
|
49
|
-
* If all names used are unqualified, the sort order won't make a difference.
|
|
50
|
-
* However, if one or more of the names are partially or fully qualified, the chosen
|
|
51
|
-
* sort order will determine how the sorting between unqualified, partially and
|
|
52
|
-
* fully qualified names is handled.
|
|
53
|
-
*
|
|
54
|
-
* The sniff supports two sort order options:
|
|
55
|
-
* - 'name' : sort by the interface name only (default);
|
|
56
|
-
* - 'full' : sort by the full name as used in the statement (without leading backslash).
|
|
57
|
-
*
|
|
58
|
-
* In both cases, the sorting will be done using natural sort, case-insensitive.
|
|
59
|
-
*
|
|
60
|
-
* Example:
|
|
61
|
-
* <code>
|
|
62
|
-
* class Foo implements \Vendor\DiffIterator, My\Count, DateTimeInterface {}
|
|
63
|
-
* </code>
|
|
64
|
-
*
|
|
65
|
-
* If sorted using the "name" sort-order, the sniff looks just at the interface name, i.e.
|
|
66
|
-
* `DiffIterator`, `Count` and `DateTimeInterface`, which for this example would mean
|
|
67
|
-
* the correct order would be `My\Count, DateTimeInterface, \Vendor\DiffIterator`.
|
|
68
|
-
*
|
|
69
|
-
* If sorted using the "full" sort-order, the sniff will look at the full name as used
|
|
70
|
-
* in the `implements` statement, without leading backslashes.
|
|
71
|
-
* For the example above, this would mean that the correct order would be:
|
|
72
|
-
* `DateTimeInterface, My\Count, \Vendor\DiffIterator`.
|
|
73
|
-
*
|
|
74
|
-
* @since 1.0.0
|
|
75
|
-
*
|
|
76
|
-
* @var string
|
|
77
|
-
*/
|
|
78
|
-
public $orderby = 'name';
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Returns an array of tokens this test wants to listen for.
|
|
82
|
-
*
|
|
83
|
-
* @since 1.0.0
|
|
84
|
-
*
|
|
85
|
-
* @return array<int|string>
|
|
86
|
-
*/
|
|
87
|
-
public function register()
|
|
88
|
-
{
|
|
89
|
-
return (Collections::ooCanExtend() + Collections::ooCanImplement());
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Processes this test, when one of its tokens is encountered.
|
|
94
|
-
*
|
|
95
|
-
* @since 1.0.0
|
|
96
|
-
*
|
|
97
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
98
|
-
* @param int $stackPtr The position of the current token in
|
|
99
|
-
* the stack passed in $tokens.
|
|
100
|
-
*
|
|
101
|
-
* @return void
|
|
102
|
-
*/
|
|
103
|
-
public function process(File $phpcsFile, $stackPtr)
|
|
104
|
-
{
|
|
105
|
-
/*
|
|
106
|
-
* Validate the setting.
|
|
107
|
-
*/
|
|
108
|
-
if ($this->orderby !== 'full') {
|
|
109
|
-
// Use the default.
|
|
110
|
-
$this->orderby = 'name';
|
|
111
|
-
}
|
|
112
|
-
$metricNameAlpha = \sprintf(self::METRIC_NAME_ALPHA, $this->orderby);
|
|
113
|
-
|
|
114
|
-
$tokens = $phpcsFile->getTokens();
|
|
115
|
-
if (isset($tokens[$stackPtr]['scope_opener']) === false) {
|
|
116
|
-
// Parse error or live coding. Ignore.
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
$scopeOpener = $tokens[$stackPtr]['scope_opener'];
|
|
121
|
-
|
|
122
|
-
/*
|
|
123
|
-
* Get the names.
|
|
124
|
-
*/
|
|
125
|
-
if (isset(Collections::ooCanImplement()[$tokens[$stackPtr]['code']]) === true) {
|
|
126
|
-
$names = ObjectDeclarations::findImplementedInterfaceNames($phpcsFile, $stackPtr);
|
|
127
|
-
} else {
|
|
128
|
-
$names = ObjectDeclarations::findExtendedInterfaceNames($phpcsFile, $stackPtr);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (\is_array($names) === false) {
|
|
132
|
-
// Class/interface/enum doesn't extend or implement.
|
|
133
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_COUNT, 0);
|
|
134
|
-
$phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'n/a');
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
$count = \count($names);
|
|
139
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_COUNT, $count);
|
|
140
|
-
|
|
141
|
-
if ($count < 2) {
|
|
142
|
-
// Nothing to sort.
|
|
143
|
-
$phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'n/a');
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/*
|
|
148
|
-
* Check the order.
|
|
149
|
-
*/
|
|
150
|
-
if ($this->orderby === 'name') {
|
|
151
|
-
$sorted = $this->sortByName($names);
|
|
152
|
-
} else {
|
|
153
|
-
$sorted = $this->sortByFull($names);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if ($sorted === $names) {
|
|
157
|
-
// Order is already correct.
|
|
158
|
-
$phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'yes');
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
$phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'no');
|
|
163
|
-
|
|
164
|
-
/*
|
|
165
|
-
* Throw the error.
|
|
166
|
-
*/
|
|
167
|
-
$keyword = \T_IMPLEMENTS;
|
|
168
|
-
if (isset(Collections::ooCanImplement()[$tokens[$stackPtr]['code']]) === false) {
|
|
169
|
-
$keyword = \T_EXTENDS;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
$fixable = true;
|
|
173
|
-
$keywordPtr = $phpcsFile->findNext($keyword, ($stackPtr + 1), $scopeOpener);
|
|
174
|
-
$hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($keywordPtr + 1), $scopeOpener);
|
|
175
|
-
if ($hasComment !== false) {
|
|
176
|
-
$fixable = false;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
$error = "The interface names in a \"%s %s\" statement should be ordered alphabetically.\n";
|
|
180
|
-
$error .= 'Expected: %s; Found: %s';
|
|
181
|
-
$code = \ucfirst(\strtolower($tokens[$keywordPtr]['content'])) . 'WrongOrder';
|
|
182
|
-
$data = [
|
|
183
|
-
$tokens[$stackPtr]['content'],
|
|
184
|
-
$tokens[$keywordPtr]['content'],
|
|
185
|
-
\implode(', ', $names),
|
|
186
|
-
\implode(', ', $sorted),
|
|
187
|
-
];
|
|
188
|
-
|
|
189
|
-
if ($fixable === false) {
|
|
190
|
-
$code .= 'WithComments';
|
|
191
|
-
$phpcsFile->addError($error, $keywordPtr, $code, $data);
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// OK, so we appear to have a fixable error.
|
|
196
|
-
$fix = $phpcsFile->addFixableError($error, $keywordPtr, $code, $data);
|
|
197
|
-
if ($fix === false) {
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
$phpcsFile->fixer->beginChangeset();
|
|
202
|
-
|
|
203
|
-
// Remove the complete previous extends/implements part.
|
|
204
|
-
for ($i = ($keywordPtr + 1); $i < $scopeOpener; $i++) {
|
|
205
|
-
$phpcsFile->fixer->replaceToken($i, '');
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
$phpcsFile->fixer->addContent($keywordPtr, ' ' . \implode(', ', $sorted) . ' ');
|
|
209
|
-
|
|
210
|
-
$phpcsFile->fixer->endChangeset();
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Sort an array of potentially mixed qualified and unqualified names by the interface name.
|
|
215
|
-
*
|
|
216
|
-
* @since 1.0.0
|
|
217
|
-
*
|
|
218
|
-
* @param string[] $names Interface names, potentially mixed qualified and unqualified.
|
|
219
|
-
*
|
|
220
|
-
* @return string[]
|
|
221
|
-
*/
|
|
222
|
-
protected function sortByName(array $names)
|
|
223
|
-
{
|
|
224
|
-
$getLastName = function ($name) {
|
|
225
|
-
$last = \strrchr($name, '\\');
|
|
226
|
-
if ($last === false) {
|
|
227
|
-
$last = $name;
|
|
228
|
-
} else {
|
|
229
|
-
$last = \substr($last, 1);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
return $last;
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
return $this->sortNames($names, $getLastName);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Sort an array of potentially mixed qualified and unqualified names by the full name.
|
|
240
|
-
*
|
|
241
|
-
* @since 1.0.0
|
|
242
|
-
*
|
|
243
|
-
* @param string[] $names Interface names, potentially mixed qualified and unqualified.
|
|
244
|
-
*
|
|
245
|
-
* @return string[]
|
|
246
|
-
*/
|
|
247
|
-
protected function sortByFull(array $names)
|
|
248
|
-
{
|
|
249
|
-
$trimLeadingBackslash = function ($name) {
|
|
250
|
-
return \ltrim($name, '\\');
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
return $this->sortNames($names, $trimLeadingBackslash);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Sort an array of names.
|
|
258
|
-
*
|
|
259
|
-
* @since 1.0.0
|
|
260
|
-
*
|
|
261
|
-
* @param string[] $names Interface names, potentially mixed qualified and unqualified.
|
|
262
|
-
* @param callable $prepareNames Function to call to prepare the names before sorting.
|
|
263
|
-
*
|
|
264
|
-
* @return string[]
|
|
265
|
-
*/
|
|
266
|
-
private function sortNames(array $names, callable $prepareNames)
|
|
267
|
-
{
|
|
268
|
-
$preppedNames = \array_map($prepareNames, $names);
|
|
269
|
-
$names = \array_combine($names, $preppedNames);
|
|
270
|
-
|
|
271
|
-
\natcasesort($names);
|
|
272
|
-
|
|
273
|
-
return \array_keys($names);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
@@ -1,204 +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\Operators;
|
|
12
|
-
|
|
13
|
-
use PHP_CodeSniffer\Files\File;
|
|
14
|
-
use PHP_CodeSniffer\Sniffs\Sniff;
|
|
15
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Enforces that the concatenation operator in multi-line concatenations is in a preferred position,
|
|
19
|
-
* either always at the start of the next line or always at the end of the previous line.
|
|
20
|
-
*
|
|
21
|
-
* Note: this sniff has no opinion on spacing before/after the concatenation operator.
|
|
22
|
-
* It will normalize based on the "one space before/after" PSR-12 industry standard.
|
|
23
|
-
* If different spacing is preferred, use the `Squiz.Strings.ConcatenationSpacing` to enforce/correct that.
|
|
24
|
-
*
|
|
25
|
-
* @since 1.2.0
|
|
26
|
-
*/
|
|
27
|
-
final class ConcatPositionSniff implements Sniff
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The phrase to use for the metric recorded by this sniff.
|
|
32
|
-
*
|
|
33
|
-
* @since 1.2.0
|
|
34
|
-
*
|
|
35
|
-
* @var string
|
|
36
|
-
*/
|
|
37
|
-
const METRIC_NAME = 'Multi-line concatenation operator position';
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Position indication: start of next line.
|
|
41
|
-
*
|
|
42
|
-
* @since 1.2.0
|
|
43
|
-
*
|
|
44
|
-
* @var string
|
|
45
|
-
*/
|
|
46
|
-
const POSITION_START = 'start';
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Position indication: end of previous line.
|
|
50
|
-
*
|
|
51
|
-
* @since 1.2.0
|
|
52
|
-
*
|
|
53
|
-
* @var string
|
|
54
|
-
*/
|
|
55
|
-
const POSITION_END = 'end';
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Position indication: neither start of next line nor end of previous line.
|
|
59
|
-
*
|
|
60
|
-
* @since 1.2.0
|
|
61
|
-
*
|
|
62
|
-
* @var string
|
|
63
|
-
*/
|
|
64
|
-
const POSITION_STANDALONE = 'stand-alone';
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Preferred position for the concatenation operator.
|
|
68
|
-
*
|
|
69
|
-
* Valid values are: 'start' and 'end'.
|
|
70
|
-
* Defaults to 'start'.
|
|
71
|
-
*
|
|
72
|
-
* @since 1.2.0
|
|
73
|
-
*
|
|
74
|
-
* @var string
|
|
75
|
-
*/
|
|
76
|
-
public $allowOnly = self::POSITION_START;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Returns an array of tokens this test wants to listen for.
|
|
80
|
-
*
|
|
81
|
-
* @since 1.2.0
|
|
82
|
-
*
|
|
83
|
-
* @return array<int|string>
|
|
84
|
-
*/
|
|
85
|
-
public function register()
|
|
86
|
-
{
|
|
87
|
-
return [\T_STRING_CONCAT];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Processes this test, when one of its tokens is encountered.
|
|
92
|
-
*
|
|
93
|
-
* @since 1.2.0
|
|
94
|
-
*
|
|
95
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
96
|
-
* @param int $stackPtr The position of the current token
|
|
97
|
-
* in the stack passed in $tokens.
|
|
98
|
-
*
|
|
99
|
-
* @return int|void Integer stack pointer to skip forward or void to continue
|
|
100
|
-
* normal file processing.
|
|
101
|
-
*/
|
|
102
|
-
public function process(File $phpcsFile, $stackPtr)
|
|
103
|
-
{
|
|
104
|
-
/*
|
|
105
|
-
* Validate the setting.
|
|
106
|
-
*/
|
|
107
|
-
if ($this->allowOnly !== self::POSITION_END) {
|
|
108
|
-
// Use the default.
|
|
109
|
-
$this->allowOnly = self::POSITION_START;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
$prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);
|
|
113
|
-
$nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
|
|
114
|
-
|
|
115
|
-
if ($nextNonEmpty === false) {
|
|
116
|
-
// Parse error/live coding.
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
$tokens = $phpcsFile->getTokens();
|
|
121
|
-
if ($tokens[$prevNonEmpty]['line'] === $tokens[$nextNonEmpty]['line']) {
|
|
122
|
-
// Not multi-line concatenation. Not our target.
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
$position = self::POSITION_STANDALONE;
|
|
127
|
-
if ($tokens[$prevNonEmpty]['line'] === $tokens[$stackPtr]['line']) {
|
|
128
|
-
$position = self::POSITION_END;
|
|
129
|
-
} elseif ($tokens[$nextNonEmpty]['line'] === $tokens[$stackPtr]['line']) {
|
|
130
|
-
$position = self::POSITION_START;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Record metric.
|
|
134
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, $position);
|
|
135
|
-
|
|
136
|
-
if ($this->allowOnly === $position) {
|
|
137
|
-
// All okay.
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
$fix = $phpcsFile->addFixableError(
|
|
142
|
-
'The concatenation operator for multi-line concatenations should always be at the %s of a line.',
|
|
143
|
-
$stackPtr,
|
|
144
|
-
'Incorrect',
|
|
145
|
-
[$this->allowOnly]
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
if ($fix === true) {
|
|
149
|
-
if ($this->allowOnly === self::POSITION_END) {
|
|
150
|
-
$phpcsFile->fixer->beginChangeset();
|
|
151
|
-
|
|
152
|
-
// Move the concat operator.
|
|
153
|
-
$phpcsFile->fixer->replaceToken($stackPtr, '');
|
|
154
|
-
$phpcsFile->fixer->addContent($prevNonEmpty, ' .');
|
|
155
|
-
|
|
156
|
-
if ($position === self::POSITION_START
|
|
157
|
-
&& $tokens[($stackPtr + 1)]['code'] === \T_WHITESPACE
|
|
158
|
-
) {
|
|
159
|
-
// Remove trailing space.
|
|
160
|
-
$phpcsFile->fixer->replaceToken(($stackPtr + 1), '');
|
|
161
|
-
} elseif ($position === self::POSITION_STANDALONE) {
|
|
162
|
-
// Remove potential indentation space.
|
|
163
|
-
if ($tokens[($stackPtr - 1)]['code'] === \T_WHITESPACE) {
|
|
164
|
-
$phpcsFile->fixer->replaceToken(($stackPtr - 1), '');
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// Remove new line.
|
|
168
|
-
if ($tokens[($stackPtr + 1)]['code'] === \T_WHITESPACE) {
|
|
169
|
-
$phpcsFile->fixer->replaceToken(($stackPtr + 1), '');
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
$phpcsFile->fixer->endChangeset();
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Fixer for allowOnly === self::POSITION_START.
|
|
178
|
-
$phpcsFile->fixer->beginChangeset();
|
|
179
|
-
|
|
180
|
-
// Move the concat operator.
|
|
181
|
-
$phpcsFile->fixer->replaceToken($stackPtr, '');
|
|
182
|
-
$phpcsFile->fixer->addContentBefore($nextNonEmpty, '. ');
|
|
183
|
-
|
|
184
|
-
if ($position === self::POSITION_END
|
|
185
|
-
&& $tokens[($stackPtr - 1)]['code'] === \T_WHITESPACE
|
|
186
|
-
) {
|
|
187
|
-
// Remove trailing space.
|
|
188
|
-
$phpcsFile->fixer->replaceToken(($stackPtr - 1), '');
|
|
189
|
-
} elseif ($position === self::POSITION_STANDALONE) {
|
|
190
|
-
// Remove potential indentation space.
|
|
191
|
-
if ($tokens[($stackPtr - 1)]['code'] === \T_WHITESPACE) {
|
|
192
|
-
$phpcsFile->fixer->replaceToken(($stackPtr - 1), '');
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// Remove new line.
|
|
196
|
-
if ($tokens[($stackPtr + 1)]['code'] === \T_WHITESPACE) {
|
|
197
|
-
$phpcsFile->fixer->replaceToken(($stackPtr + 1), '');
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
$phpcsFile->fixer->endChangeset();
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php
DELETED
|
@@ -1,112 +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\Operators;
|
|
12
|
-
|
|
13
|
-
use PHP_CodeSniffer\Files\File;
|
|
14
|
-
use PHP_CodeSniffer\Sniffs\Sniff;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Enforce the use of the boolean `&&` and `||` operators instead of the logical `and`/`or` operators.
|
|
18
|
-
*
|
|
19
|
-
* Note: as the {@link https://www.php.net/manual/en/language.operators.precedence.php operator precedence}
|
|
20
|
-
* of the logical operators is significantly lower than the operator precedence of boolean operators,
|
|
21
|
-
* this sniff does not contain an auto-fixer.
|
|
22
|
-
*
|
|
23
|
-
* @since 1.0.0
|
|
24
|
-
*/
|
|
25
|
-
final class DisallowLogicalAndOrSniff 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 = 'Type of and/or operator used';
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* The tokens this sniff records metrics for.
|
|
39
|
-
*
|
|
40
|
-
* @since 1.0.0
|
|
41
|
-
*
|
|
42
|
-
* @var array<int|string, string>
|
|
43
|
-
*/
|
|
44
|
-
private $metricType = [
|
|
45
|
-
\T_LOGICAL_AND => 'logical (and/or)',
|
|
46
|
-
\T_LOGICAL_OR => 'logical (and/or)',
|
|
47
|
-
\T_BOOLEAN_AND => 'boolean (&&/||)',
|
|
48
|
-
\T_BOOLEAN_OR => 'boolean (&&/||)',
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* The tokens this sniff targets with error code and replacements.
|
|
53
|
-
*
|
|
54
|
-
* @since 1.0.0
|
|
55
|
-
*
|
|
56
|
-
* @var array<int|string, array<string, string>>
|
|
57
|
-
*/
|
|
58
|
-
private $targetTokenInfo = [
|
|
59
|
-
\T_LOGICAL_AND => [
|
|
60
|
-
'error_code' => 'LogicalAnd',
|
|
61
|
-
'replacement' => '&&',
|
|
62
|
-
],
|
|
63
|
-
\T_LOGICAL_OR => [
|
|
64
|
-
'error_code' => 'LogicalOr',
|
|
65
|
-
'replacement' => '||',
|
|
66
|
-
],
|
|
67
|
-
];
|
|
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 \array_keys($this->metricType);
|
|
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
|
-
$tokens = $phpcsFile->getTokens();
|
|
95
|
-
$tokenCode = $tokens[$stackPtr]['code'];
|
|
96
|
-
|
|
97
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, $this->metricType[$tokenCode]);
|
|
98
|
-
|
|
99
|
-
if (isset($this->targetTokenInfo[$tokenCode]) === false) {
|
|
100
|
-
// Already using boolean operator.
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
$error = 'Using logical operators is not allowed. Expected: "%s"; Found: "%s"';
|
|
105
|
-
$data = [
|
|
106
|
-
$this->targetTokenInfo[$tokenCode]['replacement'],
|
|
107
|
-
$tokens[ $stackPtr ]['content'],
|
|
108
|
-
];
|
|
109
|
-
|
|
110
|
-
$phpcsFile->addError($error, $stackPtr, $this->targetTokenInfo[$tokenCode]['error_code'], $data);
|
|
111
|
-
}
|
|
112
|
-
}
|
package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php
DELETED
|
@@ -1,76 +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\Operators;
|
|
12
|
-
|
|
13
|
-
use PHP_CodeSniffer\Files\File;
|
|
14
|
-
use PHP_CodeSniffer\Sniffs\Sniff;
|
|
15
|
-
use PHPCSUtils\Utils\Operators;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Disallow the use of short ternaries.
|
|
19
|
-
*
|
|
20
|
-
* While short ternaries are useful when used correctly, the principle of them is
|
|
21
|
-
* often misunderstood and they are more often than not used incorrectly, leading to
|
|
22
|
-
* hard to debug issues and/or PHP warnings/notices.
|
|
23
|
-
*
|
|
24
|
-
* @since 1.0.0
|
|
25
|
-
*/
|
|
26
|
-
final class DisallowShortTernarySniff implements Sniff
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Name of the metric.
|
|
31
|
-
*
|
|
32
|
-
* @since 1.0.0
|
|
33
|
-
*
|
|
34
|
-
* @var string
|
|
35
|
-
*/
|
|
36
|
-
const METRIC_NAME = 'Ternary usage';
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Registers the tokens that this sniff wants to listen for.
|
|
40
|
-
*
|
|
41
|
-
* @since 1.0.0
|
|
42
|
-
*
|
|
43
|
-
* @return array<int|string>
|
|
44
|
-
*/
|
|
45
|
-
public function register()
|
|
46
|
-
{
|
|
47
|
-
return [\T_INLINE_THEN];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Processes this test, when one of its tokens is encountered.
|
|
52
|
-
*
|
|
53
|
-
* @since 1.0.0
|
|
54
|
-
*
|
|
55
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
56
|
-
* @param int $stackPtr The position of the current token
|
|
57
|
-
* in the stack passed in $tokens.
|
|
58
|
-
*
|
|
59
|
-
* @return void
|
|
60
|
-
*/
|
|
61
|
-
public function process(File $phpcsFile, $stackPtr)
|
|
62
|
-
{
|
|
63
|
-
if (Operators::isShortTernary($phpcsFile, $stackPtr) === false) {
|
|
64
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'long');
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
$phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'short');
|
|
69
|
-
|
|
70
|
-
$phpcsFile->addError(
|
|
71
|
-
'Using short ternaries is not allowed as they are rarely used correctly',
|
|
72
|
-
$stackPtr,
|
|
73
|
-
'Found'
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
}
|