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/WhiteSpace/PrecisionAlignmentSniff.php
DELETED
|
@@ -1,445 +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\WhiteSpace;
|
|
12
|
-
|
|
13
|
-
use PHP_CodeSniffer\Files\File;
|
|
14
|
-
use PHP_CodeSniffer\Sniffs\Sniff;
|
|
15
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
16
|
-
use PHPCSUtils\BackCompat\Helper;
|
|
17
|
-
use PHPCSUtils\Tokens\Collections;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Detects when the indentation is not a multiple of a tab-width, i.e. when precision alignment is used.
|
|
21
|
-
*
|
|
22
|
-
* In rare cases, spaces for precision alignment can be intentional and acceptable,
|
|
23
|
-
* but more often than not, precision alignment is a typo.
|
|
24
|
-
*
|
|
25
|
-
* Notes:
|
|
26
|
-
* - When using this sniff with tab-based standards, please ensure that the `tab-width` is set
|
|
27
|
-
* and either don't set the `$indent` property or set it to the tab-width.
|
|
28
|
-
* - Precision alignment *within* text strings (multi-line text strings, heredocs, nowdocs)
|
|
29
|
-
* will NOT be flagged by this sniff.
|
|
30
|
-
* - The fixer works based on "best guess" and may not always result in the desired indentation.
|
|
31
|
-
* - This fixer will use tabs or spaces based on whether tabs were present in the original indent.
|
|
32
|
-
* Use the PHPCS native `Generic.WhiteSpace.DisallowTabIndent` or the
|
|
33
|
-
* `Generic.WhiteSpace.DisallowSpaceIndent` sniff to clean up the results if so desired.
|
|
34
|
-
*
|
|
35
|
-
* @since 1.0.0
|
|
36
|
-
*/
|
|
37
|
-
final class PrecisionAlignmentSniff implements Sniff
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* A list of tokenizers this sniff supports.
|
|
42
|
-
*
|
|
43
|
-
* @since 1.0.0
|
|
44
|
-
*
|
|
45
|
-
* @var string[]
|
|
46
|
-
*/
|
|
47
|
-
public $supportedTokenizers = [
|
|
48
|
-
'PHP',
|
|
49
|
-
'JS',
|
|
50
|
-
'CSS',
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The indent used for the codebase.
|
|
55
|
-
*
|
|
56
|
-
* This property is used to determine whether something is indentation or precision alignment.
|
|
57
|
-
* If this property is not set, the sniff will look to the `--tab-width` CLI value.
|
|
58
|
-
* If that also isn't set, the default tab-width of 4 will be used.
|
|
59
|
-
*
|
|
60
|
-
* @since 1.0.0
|
|
61
|
-
*
|
|
62
|
-
* @var int|null
|
|
63
|
-
*/
|
|
64
|
-
public $indent = null;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Allow for providing a list of tokens for which (preceding) precision alignment should be ignored.
|
|
68
|
-
*
|
|
69
|
-
* By default, precision alignment will always be flagged.
|
|
70
|
-
*
|
|
71
|
-
* Example usage:
|
|
72
|
-
* ```xml
|
|
73
|
-
* <rule ref="Universal.WhiteSpace.PrecisionAlignment">
|
|
74
|
-
* <properties>
|
|
75
|
-
* <property name="ignoreAlignmentBefore" type="array">
|
|
76
|
-
* <!-- Ignore precision alignment in inline HTML -->
|
|
77
|
-
* <element value="T_INLINE_HTML"/>
|
|
78
|
-
* <!-- Ignore precision alignment in multiline chained method calls. -->
|
|
79
|
-
* <element value="T_OBJECT_OPERATOR"/>
|
|
80
|
-
* </property>
|
|
81
|
-
* </properties>
|
|
82
|
-
* </rule>
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* @since 1.0.0
|
|
86
|
-
*
|
|
87
|
-
* @var string[]
|
|
88
|
-
*/
|
|
89
|
-
public $ignoreAlignmentBefore = [];
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Whether or not potential trailing whitespace on otherwise blank lines should be examined or ignored.
|
|
93
|
-
*
|
|
94
|
-
* Defaults to `true`, i.e. ignore blank lines.
|
|
95
|
-
*
|
|
96
|
-
* It is recommended to only set this to `false` if the standard including this sniff does not
|
|
97
|
-
* include the `Squiz.WhiteSpace.SuperfluousWhitespace` sniff (which is included in most standards).
|
|
98
|
-
*
|
|
99
|
-
* @since 1.0.0
|
|
100
|
-
*
|
|
101
|
-
* @var bool
|
|
102
|
-
*/
|
|
103
|
-
public $ignoreBlankLines = true;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* The --tab-width CLI value that is being used.
|
|
107
|
-
*
|
|
108
|
-
* @since 1.0.0
|
|
109
|
-
*
|
|
110
|
-
* @var int
|
|
111
|
-
*/
|
|
112
|
-
private $tabWidth;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Whitespace tokens and tokens which can contain leading whitespace.
|
|
116
|
-
*
|
|
117
|
-
* A few additional tokens will be added to this list in the register() method.
|
|
118
|
-
*
|
|
119
|
-
* @since 1.0.0
|
|
120
|
-
*
|
|
121
|
-
* @var array<int|string, int|string>
|
|
122
|
-
*/
|
|
123
|
-
private $tokensToCheck = [
|
|
124
|
-
\T_WHITESPACE => \T_WHITESPACE,
|
|
125
|
-
\T_INLINE_HTML => \T_INLINE_HTML,
|
|
126
|
-
\T_DOC_COMMENT_WHITESPACE => \T_DOC_COMMENT_WHITESPACE,
|
|
127
|
-
\T_COMMENT => \T_COMMENT,
|
|
128
|
-
\T_END_HEREDOC => \T_END_HEREDOC,
|
|
129
|
-
\T_END_NOWDOC => \T_END_NOWDOC,
|
|
130
|
-
];
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Returns an array of tokens this test wants to listen for.
|
|
134
|
-
*
|
|
135
|
-
* @since 1.0.0
|
|
136
|
-
*
|
|
137
|
-
* @return array<int|string>
|
|
138
|
-
*/
|
|
139
|
-
public function register()
|
|
140
|
-
{
|
|
141
|
-
// Add the ignore annotation tokens to the list of tokens to check.
|
|
142
|
-
$this->tokensToCheck += Tokens::$phpcsCommentTokens;
|
|
143
|
-
|
|
144
|
-
return Collections::phpOpenTags();
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Processes this test, when one of its tokens is encountered.
|
|
149
|
-
*
|
|
150
|
-
* @since 1.0.0
|
|
151
|
-
*
|
|
152
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
153
|
-
* @param int $stackPtr The position of the current token
|
|
154
|
-
* in the stack passed in $tokens.
|
|
155
|
-
*
|
|
156
|
-
* @return int Integer stack pointer to skip the rest of the file.
|
|
157
|
-
*/
|
|
158
|
-
public function process(File $phpcsFile, $stackPtr)
|
|
159
|
-
{
|
|
160
|
-
/*
|
|
161
|
-
* Handle the properties.
|
|
162
|
-
*/
|
|
163
|
-
if (isset($this->tabWidth) === false || \defined('PHP_CODESNIFFER_IN_TESTS') === true) {
|
|
164
|
-
$this->tabWidth = Helper::getTabWidth($phpcsFile);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (isset($this->indent) === true) {
|
|
168
|
-
$indent = (int) $this->indent;
|
|
169
|
-
} else {
|
|
170
|
-
$indent = $this->tabWidth;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
$ignoreTokens = (array) $this->ignoreAlignmentBefore;
|
|
174
|
-
if (empty($ignoreTokens) === false) {
|
|
175
|
-
$ignoreTokens = \array_flip($ignoreTokens);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/*
|
|
179
|
-
* Check the whole file in one go.
|
|
180
|
-
*/
|
|
181
|
-
$tokens = $phpcsFile->getTokens();
|
|
182
|
-
|
|
183
|
-
for ($i = 0; $i < $phpcsFile->numTokens; $i++) {
|
|
184
|
-
if ($tokens[$i]['column'] !== 1) {
|
|
185
|
-
// Only interested in the first token on each line.
|
|
186
|
-
continue;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (isset($this->tokensToCheck[$tokens[$i]['code']]) === false) {
|
|
190
|
-
// Not one of the target tokens.
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if ($tokens[$i]['content'] === $phpcsFile->eolChar) {
|
|
195
|
-
// Skip completely blank lines.
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (isset($ignoreTokens[$tokens[$i]['type']]) === true
|
|
200
|
-
|| (isset($tokens[($i + 1)]) && isset($ignoreTokens[$tokens[($i + 1)]['type']]))
|
|
201
|
-
) {
|
|
202
|
-
// This is one of the tokens being ignored.
|
|
203
|
-
continue;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
$origContent = null;
|
|
207
|
-
if (isset($tokens[$i]['orig_content']) === true) {
|
|
208
|
-
$origContent = $tokens[$i]['orig_content'];
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
$spaces = 0;
|
|
212
|
-
$length = 0;
|
|
213
|
-
$content = '';
|
|
214
|
-
$closer = '';
|
|
215
|
-
|
|
216
|
-
switch ($tokens[$i]['code']) {
|
|
217
|
-
case \T_WHITESPACE:
|
|
218
|
-
if ($this->ignoreBlankLines === true
|
|
219
|
-
&& isset($tokens[($i + 1)])
|
|
220
|
-
&& $tokens[$i]['line'] !== $tokens[($i + 1)]['line']
|
|
221
|
-
) {
|
|
222
|
-
// Skip blank lines which only contain trailing whitespace.
|
|
223
|
-
continue 2;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
$spaces = ($tokens[$i]['length'] % $indent);
|
|
227
|
-
break;
|
|
228
|
-
|
|
229
|
-
case \T_DOC_COMMENT_WHITESPACE:
|
|
230
|
-
/*
|
|
231
|
-
* Blank lines with trailing whitespace in docblocks are tokenized as
|
|
232
|
-
* two T_DOC_COMMENT_WHITESPACE tokens: one for the trailing whitespace,
|
|
233
|
-
* one for the new line character.
|
|
234
|
-
*/
|
|
235
|
-
if ($this->ignoreBlankLines === true
|
|
236
|
-
&& isset($tokens[($i + 1)])
|
|
237
|
-
&& $tokens[($i + 1)]['content'] === $phpcsFile->eolChar
|
|
238
|
-
&& isset($tokens[($i + 2)])
|
|
239
|
-
&& $tokens[$i]['line'] !== $tokens[($i + 2)]['line']
|
|
240
|
-
) {
|
|
241
|
-
// Skip blank lines which only contain trailing whitespace.
|
|
242
|
-
continue 2;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
$spaces = ($tokens[$i]['length'] % $indent);
|
|
246
|
-
|
|
247
|
-
if (isset($tokens[($i + 1)]) === true
|
|
248
|
-
&& ($tokens[($i + 1)]['code'] === \T_DOC_COMMENT_STAR
|
|
249
|
-
|| $tokens[($i + 1)]['code'] === \T_DOC_COMMENT_CLOSE_TAG)
|
|
250
|
-
&& $spaces !== 0
|
|
251
|
-
) {
|
|
252
|
-
// One alignment space expected before the *.
|
|
253
|
-
--$spaces;
|
|
254
|
-
}
|
|
255
|
-
break;
|
|
256
|
-
|
|
257
|
-
case \T_COMMENT:
|
|
258
|
-
case \T_INLINE_HTML:
|
|
259
|
-
if ($this->ignoreBlankLines === true
|
|
260
|
-
&& \trim($tokens[$i]['content']) === ''
|
|
261
|
-
&& isset($tokens[($i + 1)])
|
|
262
|
-
&& $tokens[$i]['line'] !== $tokens[($i + 1)]['line']
|
|
263
|
-
) {
|
|
264
|
-
// Skip blank lines which only contain trailing whitespace.
|
|
265
|
-
continue 2;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// Deliberate fall-through.
|
|
269
|
-
|
|
270
|
-
case \T_PHPCS_ENABLE:
|
|
271
|
-
case \T_PHPCS_DISABLE:
|
|
272
|
-
case \T_PHPCS_SET:
|
|
273
|
-
case \T_PHPCS_IGNORE:
|
|
274
|
-
case \T_PHPCS_IGNORE_FILE:
|
|
275
|
-
/*
|
|
276
|
-
* Indentation is included in the contents of the token for:
|
|
277
|
-
* - inline HTML
|
|
278
|
-
* - PHP 7.3+ flexible heredoc/nowdoc closer identifiers (see below);
|
|
279
|
-
* - subsequent lines of multi-line comments;
|
|
280
|
-
* - PHPCS native annotations when part of a multi-line comment.
|
|
281
|
-
*/
|
|
282
|
-
$content = \ltrim($tokens[$i]['content']);
|
|
283
|
-
$whitespace = \str_replace($content, '', $tokens[$i]['content']);
|
|
284
|
-
|
|
285
|
-
/*
|
|
286
|
-
* If there is no content, this is a blank line in a comment or in inline HTML.
|
|
287
|
-
* In that case, use the predetermined length as otherwise the new line character
|
|
288
|
-
* at the end of the whitespace will throw the count off.
|
|
289
|
-
*/
|
|
290
|
-
$length = ($content === '') ? $tokens[$i]['length'] : \strlen($whitespace);
|
|
291
|
-
$spaces = ($length % $indent);
|
|
292
|
-
|
|
293
|
-
/*
|
|
294
|
-
* For multi-line star-comments, which use (aligned) stars on subsequent
|
|
295
|
-
* lines, we don't want to trigger on the one extra space before the star.
|
|
296
|
-
*
|
|
297
|
-
* While not 100% correct, don't exclude inline HTML from this check as
|
|
298
|
-
* otherwise the sniff would trigger on multi-line /*-style inline javascript comments.
|
|
299
|
-
* This may cause false negatives as there is no check for being in a
|
|
300
|
-
* <script> tag, but that will be rare.
|
|
301
|
-
*/
|
|
302
|
-
if (isset($content[0]) === true && $content[0] === '*' && $spaces !== 0) {
|
|
303
|
-
--$spaces;
|
|
304
|
-
}
|
|
305
|
-
break;
|
|
306
|
-
|
|
307
|
-
case \T_END_HEREDOC:
|
|
308
|
-
case \T_END_NOWDOC:
|
|
309
|
-
/*
|
|
310
|
-
* PHPCS does not execute tab replacement in heredoc/nowdoc closer
|
|
311
|
-
* tokens prior to PHPCS 3.7.2, so handle this ourselves.
|
|
312
|
-
*/
|
|
313
|
-
$content = $tokens[$i]['content'];
|
|
314
|
-
if (\strpos($tokens[$i]['content'], "\t") !== false) {
|
|
315
|
-
$origContent = $content;
|
|
316
|
-
$content = \str_replace("\t", \str_repeat(' ', $this->tabWidth), $content);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
$closer = \ltrim($content);
|
|
320
|
-
$whitespace = \str_replace($closer, '', $content);
|
|
321
|
-
$length = \strlen($whitespace);
|
|
322
|
-
$spaces = ($length % $indent);
|
|
323
|
-
break;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
if ($spaces === 0) {
|
|
327
|
-
continue;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
$fix = $phpcsFile->addFixableWarning(
|
|
331
|
-
'Found precision alignment of %s spaces.',
|
|
332
|
-
$i,
|
|
333
|
-
'Found',
|
|
334
|
-
[$spaces]
|
|
335
|
-
);
|
|
336
|
-
|
|
337
|
-
if ($fix === true) {
|
|
338
|
-
if ($tokens[$i]['code'] === \T_END_HEREDOC || $tokens[$i]['code'] === \T_END_NOWDOC) {
|
|
339
|
-
// For heredoc/nowdoc, always round down to prevent introducing parse errors.
|
|
340
|
-
$tabstops = (int) \floor($spaces / $indent);
|
|
341
|
-
} else {
|
|
342
|
-
// For everything else, use "best guess".
|
|
343
|
-
$tabstops = (int) \round($spaces / $indent, 0);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
switch ($tokens[$i]['code']) {
|
|
347
|
-
case \T_WHITESPACE:
|
|
348
|
-
/*
|
|
349
|
-
* More complex than you'd think as "length" doesn't include new lines,
|
|
350
|
-
* but we don't want to remove new lines either.
|
|
351
|
-
*/
|
|
352
|
-
$replaceLength = (((int) ($tokens[$i]['length'] / $indent) + $tabstops) * $indent);
|
|
353
|
-
$replace = $this->getReplacement($replaceLength, $origContent);
|
|
354
|
-
$newContent = \substr_replace($tokens[$i]['content'], $replace, 0, $tokens[$i]['length']);
|
|
355
|
-
|
|
356
|
-
$phpcsFile->fixer->replaceToken($i, $newContent);
|
|
357
|
-
break;
|
|
358
|
-
|
|
359
|
-
case \T_DOC_COMMENT_WHITESPACE:
|
|
360
|
-
$replaceLength = (((int) ($tokens[$i]['length'] / $indent) + $tabstops) * $indent);
|
|
361
|
-
$replace = $this->getReplacement($replaceLength, $origContent);
|
|
362
|
-
|
|
363
|
-
if (isset($tokens[($i + 1)]) === true
|
|
364
|
-
&& ($tokens[($i + 1)]['code'] === \T_DOC_COMMENT_STAR
|
|
365
|
-
|| $tokens[($i + 1)]['code'] === \T_DOC_COMMENT_CLOSE_TAG)
|
|
366
|
-
&& $tabstops === 0
|
|
367
|
-
) {
|
|
368
|
-
// Maintain the extra space before the star.
|
|
369
|
-
$replace .= ' ';
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
$newContent = \substr_replace($tokens[$i]['content'], $replace, 0, $tokens[$i]['length']);
|
|
373
|
-
|
|
374
|
-
$phpcsFile->fixer->replaceToken($i, $newContent);
|
|
375
|
-
break;
|
|
376
|
-
|
|
377
|
-
case \T_COMMENT:
|
|
378
|
-
case \T_INLINE_HTML:
|
|
379
|
-
case \T_PHPCS_ENABLE:
|
|
380
|
-
case \T_PHPCS_DISABLE:
|
|
381
|
-
case \T_PHPCS_SET:
|
|
382
|
-
case \T_PHPCS_IGNORE:
|
|
383
|
-
case \T_PHPCS_IGNORE_FILE:
|
|
384
|
-
$replaceLength = (((int) ($length / $indent) + $tabstops) * $indent);
|
|
385
|
-
$replace = $this->getReplacement($replaceLength, $origContent);
|
|
386
|
-
|
|
387
|
-
if (isset($content[0]) === true && $content[0] === '*' && $tabstops === 0) {
|
|
388
|
-
// Maintain the extra space before the star.
|
|
389
|
-
$replace .= ' ';
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
if ($content === '') {
|
|
393
|
-
// Preserve new lines in blank line comment tokens.
|
|
394
|
-
$newContent = \substr_replace($tokens[$i]['content'], $replace, 0, $length);
|
|
395
|
-
} else {
|
|
396
|
-
$newContent = $replace . $content;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
$phpcsFile->fixer->replaceToken($i, $newContent);
|
|
400
|
-
break;
|
|
401
|
-
|
|
402
|
-
case \T_END_HEREDOC:
|
|
403
|
-
case \T_END_NOWDOC:
|
|
404
|
-
$replaceLength = (((int) ($length / $indent) + $tabstops) * $indent);
|
|
405
|
-
$replace = $this->getReplacement($replaceLength, $origContent);
|
|
406
|
-
|
|
407
|
-
$phpcsFile->fixer->replaceToken($i, $replace . $closer);
|
|
408
|
-
break;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// No need to look at this file again.
|
|
414
|
-
return $phpcsFile->numTokens;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Get the whitespace replacement. Respect tabs vs spaces.
|
|
419
|
-
*
|
|
420
|
-
* @param int $length The target length of the replacement.
|
|
421
|
-
* @param string|null $origContent The original token content without tabs replaced (if available).
|
|
422
|
-
*
|
|
423
|
-
* @return string
|
|
424
|
-
*/
|
|
425
|
-
private function getReplacement($length, $origContent)
|
|
426
|
-
{
|
|
427
|
-
if ($origContent !== null) {
|
|
428
|
-
// Check whether tabs were part of the indent or inline alignment.
|
|
429
|
-
$content = \ltrim($origContent);
|
|
430
|
-
$whitespace = $origContent;
|
|
431
|
-
if ($content !== '') {
|
|
432
|
-
$whitespace = \str_replace($content, '', $origContent);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
if (\strpos($whitespace, "\t") !== false) {
|
|
436
|
-
// Original indent used tabs. Use tabs in replacement too.
|
|
437
|
-
$tabs = (int) ($length / $this->tabWidth);
|
|
438
|
-
$spaces = $length % $this->tabWidth;
|
|
439
|
-
return \str_repeat("\t", $tabs) . \str_repeat(' ', (int) $spaces);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
return \str_repeat(' ', $length);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0"?>
|
|
2
|
-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Universal" namespace="PHPCSExtra\Universal" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
|
|
3
|
-
|
|
4
|
-
<description>A collection of universal sniffs. This standard is not designed to be used to check code. Include individual sniffs from this standard in a custom ruleset instead.</description>
|
|
5
|
-
</ruleset>
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name" : "phpcsstandards/phpcsextra",
|
|
3
|
-
"description" : "A collection of sniffs and standards for use with PHP_CodeSniffer.",
|
|
4
|
-
"type" : "phpcodesniffer-standard",
|
|
5
|
-
"keywords" : [ "phpcs", "phpcbf", "standards", "static analysis", "php_codesniffer", "phpcodesniffer-standard" ],
|
|
6
|
-
"license" : "LGPL-3.0-or-later",
|
|
7
|
-
"authors" : [
|
|
8
|
-
{
|
|
9
|
-
"name" : "Juliette Reinders Folmer",
|
|
10
|
-
"role" : "lead",
|
|
11
|
-
"homepage" : "https://github.com/jrfnl"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name" : "Contributors",
|
|
15
|
-
"homepage" : "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors"
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
"support" : {
|
|
19
|
-
"issues" : "https://github.com/PHPCSStandards/PHPCSExtra/issues",
|
|
20
|
-
"source" : "https://github.com/PHPCSStandards/PHPCSExtra",
|
|
21
|
-
"security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy"
|
|
22
|
-
},
|
|
23
|
-
"require" : {
|
|
24
|
-
"php" : ">=5.4",
|
|
25
|
-
"squizlabs/php_codesniffer" : "^3.8.0",
|
|
26
|
-
"phpcsstandards/phpcsutils" : "^1.0.9"
|
|
27
|
-
},
|
|
28
|
-
"require-dev" : {
|
|
29
|
-
"php-parallel-lint/php-parallel-lint": "^1.3.2",
|
|
30
|
-
"php-parallel-lint/php-console-highlighter": "^1.0",
|
|
31
|
-
"phpcsstandards/phpcsdevcs": "^1.1.6",
|
|
32
|
-
"phpcsstandards/phpcsdevtools": "^1.2.1",
|
|
33
|
-
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
|
|
34
|
-
},
|
|
35
|
-
"extra": {
|
|
36
|
-
"branch-alias": {
|
|
37
|
-
"dev-stable": "1.x-dev",
|
|
38
|
-
"dev-develop": "1.x-dev"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"scripts" : {
|
|
42
|
-
"lint": [
|
|
43
|
-
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . --show-deprecated -e php --exclude vendor --exclude .git"
|
|
44
|
-
],
|
|
45
|
-
"checkcs": [
|
|
46
|
-
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs"
|
|
47
|
-
],
|
|
48
|
-
"fixcs": [
|
|
49
|
-
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
|
|
50
|
-
],
|
|
51
|
-
"check-complete": [
|
|
52
|
-
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness ./Modernize ./NormalizedArrays ./Universal"
|
|
53
|
-
],
|
|
54
|
-
"test": [
|
|
55
|
-
"@php ./vendor/phpunit/phpunit/phpunit --filter PHPCSExtra --no-coverage ./vendor/squizlabs/php_codesniffer/tests/AllTests.php"
|
|
56
|
-
],
|
|
57
|
-
"coverage": [
|
|
58
|
-
"@php ./vendor/phpunit/phpunit/phpunit --filter PHPCSExtra ./vendor/squizlabs/php_codesniffer/tests/AllTests.php"
|
|
59
|
-
],
|
|
60
|
-
"coverage-local": [
|
|
61
|
-
"@php ./vendor/phpunit/phpunit/phpunit --filter PHPCSExtra ./vendor/squizlabs/php_codesniffer/tests/AllTests.php --coverage-html ./build/coverage-html"
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
|
-
"config": {
|
|
65
|
-
"allow-plugins": {
|
|
66
|
-
"dealerdirect/phpcodesniffer-composer-installer": true
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
-
<phpdocumentor
|
|
3
|
-
configVersion="3"
|
|
4
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
5
|
-
xmlns="https://www.phpdoc.org"
|
|
6
|
-
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/phpDocumentor/phpDocumentor/master/data/xsd/phpdoc.xsd"
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
<title>PHPCSUtils</title>
|
|
10
|
-
|
|
11
|
-
<paths>
|
|
12
|
-
<output>docs/phpdoc/</output>
|
|
13
|
-
<cache>build/docs/structure/</cache>
|
|
14
|
-
</paths>
|
|
15
|
-
|
|
16
|
-
<version number="latest">
|
|
17
|
-
<api format="php">
|
|
18
|
-
<source dsn=".">
|
|
19
|
-
<path>phpcsutils-autoload.php</path>
|
|
20
|
-
<path>PHPCSUtils</path>
|
|
21
|
-
</source>
|
|
22
|
-
<ignore hidden="true" symlinks="true">
|
|
23
|
-
<path>PHPCSUtils/Internal/**/*</path>
|
|
24
|
-
</ignore>
|
|
25
|
-
<visibility>public</visibility>
|
|
26
|
-
<visibility>protected</visibility>
|
|
27
|
-
<ignore-tags>
|
|
28
|
-
<ignore-tag>codeCoverageIgnore</ignore-tag>
|
|
29
|
-
<ignore-tag>phpcs</ignore-tag>
|
|
30
|
-
</ignore-tags>
|
|
31
|
-
</api>
|
|
32
|
-
</version>
|
|
33
|
-
|
|
34
|
-
<template name="default"/>
|
|
35
|
-
|
|
36
|
-
</phpdocumentor>
|