feat: add PHP_CodeSniffer 4.x support#724
Open
MickaelN wants to merge 1 commit into
Open
Conversation
Upgrade squizlabs/php_codesniffer from ^3.13.5 to ^4.0 and slevomat/coding-standard from ^8.22.1 to ^8.23. Changes: - File.php: typed addMessage() signature, fixableCount replaced by fixableErrorCount/fixableWarningCount - SniffDecorator.php: typed process() parameter - ForbiddenSetterSniff.php: typed process() parameter, dotted error code to comply with PHPCS 4 naming validation, getDeclarationName empty string check - Metrics: removed CodeAnalyzerSniff (dropped from Zend in PHPCS 4, redundant with SyntaxCheck), removed CallTimePassByReferenceSniff (dropped, irrelevant since PHP 5.4), moved LanguageConstructSpacingSniff from Squiz to Generic namespace - TestCase: manual sniff registration to bypass PHPCS 4 namespace convention validation for custom sniffs Closes nunomaduro#723
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades
squizlabs/php_codesnifferfrom^3.13.5to^4.0andslevomat/coding-standardfrom^8.22.1to^8.23.Closes #723
Changes
Core:
File.php: typedaddMessage()signature,fixableCountreplaced byfixableErrorCount/fixableWarningCountSniffDecorator.php: typedprocess()parameterForbiddenSetterSniff.php: typedprocess()parameter, dotted error code to comply with PHPCS 4 naming validation,getDeclarationNameempty string checkRemoved sniffs (dropped in PHPCS 4):
Zend\Debug\CodeAnalyzerSniff— removed without replacement (redundant withSyntaxCheckwhich usesparallel-lint)Generic\Functions\CallTimePassByReferenceSniff— removed without replacement (call-time pass-by-reference is a syntax error since PHP 5.4, irrelevant for PHP 8.3+)Moved sniff:
Squiz\WhiteSpace\LanguageConstructSpacingSniff→Generic\WhiteSpace\LanguageConstructSpacingSniffTests:
TestCase::prepareFixtureWithSniff(): manual sniff registration to bypass PHPCS 4 namespace convention validation inpopulateTokenListeners()for custom sniffs outside theStandard\Sniffs\CategorynamespaceVerification