Added
- Added support for PHP 8.4 asymmetric visibility modifiers to the tokenizer. #871
- Thanks to Daniel Scherzer for the patch.
- Added support for PHP 8.4
final
properties to the following sniffs:- PSR2.Classes.PropertyDeclaration #950
- Thanks to Juliette Reinders Folmer for the patches.
Changed
- Generic.WhiteSpace.LanguageConstructSpacing: will now also check the spacing after the
goto
language construct keyword. #917- Thanks to Juliette Reinders Folmer for the patch.
- The PSR2.Classes.PropertyDeclaration will now check that the
final
modifier keyword is placed before a visibility keyword. #950- Errors will be reported via a new
FinalAfterVisibility
error code. - Thanks to Juliette Reinders Folmer for the patch.
- Errors will be reported via a new
- Improved Help information about the
--reports
CLI flag. #1078- Thanks to Juliette Reinders Folmer for the patch.
- The documentation for the following sniffs has been improved:
- PSR1.Files.SideEffects
- PSR2.ControlStructures.SwitchDeclaration
- PSR2.Namespaces.NamespaceDeclaration
- Thanks to Rodrigo Primo for the patches.
- Various housekeeping, including improvements to the tests and documentation.
- Thanks to Juliette Reinders Folmer for their contributions.
Deprecated
- Nearly everything which was soft deprecated before is now hard deprecated and will show deprecation notices:
- This applies to:
- All sniffs which will be removed in 4.0. #888
- The deprecated Generator methods. #889
- The old array property setting format (via comma separated strings). #890
- Sniffs not implementing the
PHP_CodeSniffer\Sniffs\Sniff
interface. #891 - Sniffs not following the naming conventions. #892
- Standards called Internal. #893
- Sniffs which don't listen for PHP, like JS/CSS specific sniffs. #894
- The deprecation notices can be silenced by using the
-q
(=quiet) CLI flag. - Thanks to Juliette Reinders Folmer for the patches.
- This applies to:
Fixed
- Fixed bug #1040 : Generic.Strings.UnnecessaryHeredoc - false positive for heredocs containing escape sequences.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #1040 : Generic.Strings.UnnecessaryHeredoc - fixer would not clean up escape sequences which aren't necessary in nowdocs.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #1048 : A file under scan would sometimes be updated with partial fixes, even though the file "failed to fix".
- Thanks to Juliette Reinders Folmer for the patch.
Other
Calling all testers!
The first beta release for PHP_CodeSniffer 4.0 has been tagged. Please help by testing the beta release and reporting any issues you run into.
Upgrade guides for both ruleset maintainers/end-users, as well as for sniff developers and integrators, have been published to the Wiki to help smooth the transition.
Statistics
Closed: 3 issues
Merged: 29 pull requests
Follow @phpcs on Mastodon or @PHP_CodeSniffer on X to stay informed.
Please consider funding the PHP_CodeSniffer project. If you already do so: thank you!