Releases: PHPCSStandards/PHP_CodeSniffer
4.0.0 - 2025-09-16
This release contains breaking changes.
Upgrade guides for both ruleset maintainers/end-users, as well as for sniff developers and integrators, have been published to the Wiki.
You are strongly encouraged to read the upgrade guide applicable to your situation before upgrading.
This release includes all improvements and bugfixes from PHP_CodeSniffer 4.0.0-beta1, 4.0.0-RC1, 3.13.3 and 3.13.4.
Changed
- Tokenizer/PHP: fully qualified
exit
/die
/true
/false
/null
will be tokenized as the keyword token and the token'content'
will include the leading backslash. #1201 - Wherever possible based on the PHP 7.2 minimum version, parameter types have been added to all methods. #1237
- The supported PHPUnit version constraints have been updated to
^8.4.0 || ^9.3.4 || ^10.5.32 || 11.3.3 - 11.5.28 || ^11.5.31
. #1247- External standards using the PHP_CodeSniffer native framework may need to update their own PHPUnit version constraints.
- Various housekeeping, including improvements to the tests and documentation.
Fixed
- Fixed bug #1082: new exit codes weren't applied when running
phpcbf
on code provided via STDIN.- Thanks to Dan Wallis for the patch.
- Fixed bug #1172:
// phpcs:set
for inline array properties did not handle a single item array with the valuetrue
,false
ornull
correctly. - Fixed bug #1174: progress bar wasn't showing files as fixed when running
phpcbf
in parallel mode. - Fixed bug #1226: PHP 8.5 "Using null as an array offset" deprecation notice.
Other
- Please be aware that the
master
branch has been renamed to3.x
and the default branch has changed to the4.x
branch.- If you contribute to PHP_CodeSniffer, you will need to update your local git clone.
- If you develop against PHP_CodeSniffer and run your tests against dev branches of PHPCS, you will need to update your workflows.
Statistics
Closed: 5 issues
Merged: 35 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!
3.13.4 - 2025-09-05
Fixed
- Fixed bug #1213: ability to run tests for external standards using the PHPCS native test framework was broken.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #1215: PHP 8.5 "Using null as an array offset" deprecation notices.
- Thanks to Juliette Reinders Folmer for the patch.
Statistics
Closed: 0 issues
Merged: 3 pull requests
If you like to stay informed about releases and more, follow @phpcs on Mastodon or @PHP_CodeSniffer on X.
Please consider funding the PHP_CodeSniffer project. If you already do so: thank you!
3.13.3 - 2025-09-04
Added
- Tokenizer support for PHP 8.4 dereferencing of new expressions without wrapping parentheses. #1160
- Thanks to Juliette Reinders Folmer for the patch.
- Tokenizer support for PHP 8.4
abstract
properties. #1183- The
File::getMemberProperties()
method now also supportsabstract
properties through a newis_abstract
array index in the return value. #1184 - Additionally, the following sniffs have been updated to support
abstract
properties: - Thanks to Juliette Reinders Folmer for the patches
- The
- Tokenizer support for the PHP 8.4 "exit as a function call" change. #1201
- When
exit
/die
is used as a fully qualified "function call", it will now be tokenized asT_NS_SEPARATOR
+T_EXIT
. - Additionally, the following sniff has been updated to handle fully qualified exit/die correctly:
- Squiz.PHP.NonExecutableCode
- Thanks to Juliette Reinders Folmer for the patches
- When
Changed
- Tokenizer/PHP: fully qualified
true
/false
/null
will now be tokenized asT_NS_SEPARATOR
+T_TRUE
/T_FALSE
/T_NULL
. #1201- Previously, these were tokenized as
T_NS_SEPARATOR
+T_STRING
. - Additionally, the following sniffs have been updated to handle fully qualified true/false/null correctly:
- Generic.CodeAnalysis.UnconditionalIfStatement
- Generic.ControlStructures.DisallowYodaConditions
- PEAR.Functions.ValidDefaultValue
- Thanks to Juliette Reinders Folmer for the patches.
- Previously, these were tokenized as
- Generic.PHP.Syntax: the sniff is now able to scan input provided via STDIN on non-Windows OSes. #915
- Thanks to Rodrigo Primo for the patch.
- PSR2.ControlStructures.SwitchDeclaration: the
WrongOpener*
error code is now auto-fixable if the identified "wrong opener" is a semi-colon. #1161- Thanks to Juliette Reinders Folmer for the patch.
- The PSR2.Classes.PropertyDeclaration will now check that the abstract modifier keyword is placed before a visibility keyword. #1188
- Errors will be reported via a new
AbstractAfterVisibility
error code. - Thanks to Juliette Reinders Folmer for the patch.
- Errors will be reported via a new
- Various housekeeping, including improvements to the tests and documentation.
- Thanks to Bernhard Zwein, Rick Kerkhof, Rodrigo Primo and Juliette Reinders Folmer for their contributions.
Fixed
- Fixed bug #1112 :
--parallel
option fails if PHP_CodeSniffer is invoked via bash and the invokation creates a non-PHPCS-managed process.- Thanks to Rick Kerkhof for the patch.
- Fixed bug #1113 : fatal error when the specified "files to scan" would result in the same file being added multiple times to the queue.
- This error only occured when
--parallel
scanning was enabled. - Thanks to Rodrigo Primo for the patch.
- This error only occured when
- Fixed bug #1154 : PEAR.WhiteSpace.ObjectOperatorIndent: false positive when checking multiple chained method calls in a multidimensional array.
- Thanks to Rodrigo Primo for the patch.
- Fixed bug #1193 : edge case inconsistency in how empty string array keys for sniff properties are handled.
- Thanks to Rodrigo Primo and Juliette Reinders Folmer for the patch.
- Fixed bug #1197 : Squiz.Commenting.FunctionComment: return types containing a class name with underscores would be truncated leading to incorrect results.
- Thanks to Juliette Reinders Folmer for the patch.
Other
- The Wiki documentation is now publicly editable. 🎉
- Update proposals can be submittted by opening a pull request in the PHPCSStandards/PHP_CodeSniffer-documentation repository.
Contributions welcome ! - Thanks to Anna Filina, Dan Wallis and Juliette Reinders Folmer for their work on getting this set up.
- Update proposals can be submittted by opening a pull request in the PHPCSStandards/PHP_CodeSniffer-documentation repository.
- The Phar website has had a facelift. #107
- Thanks to Bernhard Zwein for making this happen!
New Contributors
The PHP_CodeSniffer project is happy to welcome the following new contributors:
@benno5020, @NanoSector
Statistics
Closed: 11 issues
Merged: 40 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!
4.0.0RC1 - 2025-06-18
This release includes all improvements and bugfixes from PHP_CodeSniffer 4.0.0-beta1, 3.13.1 and 3.13.2.
Changed
- The error code
Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterVisbility
has been changed toSquiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterVisibility
. #1136 - The following sniff(s) have received efficiency improvements:
- Generic.ControlStructures.InlineControlStructure #880
- Thanks to Rodrigo Primo for the patch.
Fixed
- Fixed bug #3889 : A selective
phpcs:enable
could sometimes override a later selectivephpcs:ignore
.- Thanks to Brad Jorsch for the patch
- Fixed bug #1128 : missing 'parenthesis_owner' index for T_FUNCTION token on PHP < 7.4 when function is named "fn".
Other
- The GPG signature for the PHAR files has been rotated. The new fingerprint is: D91D86963AF3A29B6520462297B02DD8E5071466.
Calling all testers!
Please help by testing the RC 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: 2 issues
Merged: 4 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!
3.13.2 - 2025-06-18
Changed
- The documentation for the following sniffs has been improved:
- Squiz.Classes.SelfMemberReference
- Thanks to Rodrigo Primo for the patch.
- Various housekeeping, including improvements to the tests and documentation.
- Thanks to Rodrigo Primo and Juliette Reinders Folmer for their contributions.
Fixed
- Fixed bug #1135 : Squiz.Functions.FunctionDeclarationArgumentSpacing: typo in new error code
SpacingAfterSetVis[i]bility
.- Thanks to Juliette Reinders Folmer for the patch.
Statistics
Closed: 0 issues
Merged: 6 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!
3.13.1 - 2025-06-13
Added
- Added support for PHP 8.4 properties with asymmetric visibility to File::getMemberProperties() through a new
set_scope
array index in the return value. #1116- Thanks to Juliette Reinders Folmer for the patches.
- Added support for PHP 8.4 (constructor promoted) properties with asymmetric visibility to File::getMethodParameters() through new
set_visibility
andset_visibility_token
array indexes in the return value. #1116- Thanks to Juliette Reinders Folmer for the patches.
- Added support for PHP 8.4 asymmetric visibility modifiers to the following sniffs:
- Generic.PHP.LowerCaseKeyword #1117
- PEAR.NamingConventions.ValidVariableName #1118
- PSR2.Classes.PropertyDeclaration #1119
- Squiz.Commenting.BlockComment #1120
- Squiz.Commenting.DocCommentAlignment #1120
- Squiz.Commenting.VariableComment #1120
- Squiz.Functions.FunctionDeclarationArgumentSpacing #1121
- Squiz.Scope.MemberVarScope #1122
- Squiz.WhiteSpace.MemberVarSpacing #1123
- Squiz.WhiteSpace.ScopeKeywordSpacing #1124
- Thanks to Juliette Reinders Folmer for the patches.
Changed
- The PSR2.Classes.PropertyDeclaration will now check that a set-visibility modifier keyword is placed after a potential general visibility keyword. #1119
- Errors will be reported via a new
AvizKeywordOrder
error code. - Thanks to Juliette Reinders Folmer for the patch.
- Errors will be reported via a new
- The Squiz.Functions.FunctionDeclarationArgumentSpacing will now check spacing after a set-visibility modifier keyword. #1121
- Errors will be reported via a new
SpacingAfterSetVisibility
error code. - Thanks to Juliette Reinders Folmer for the patch.
- Errors will be reported via a new
- The Squiz.Scope.MemberVarScope will now flag missing "read" visibility, when "write" visibility is set, under a separate error code
AsymReadMissing
. #1122- Thanks to Juliette Reinders Folmer for the patch.
- The documentation for the following sniffs has been improved:
- PEAR.Classes.ClassDeclaration
- Squiz.WhiteSpace.FunctionOpeningBraceSpace
- Thanks to Brian Dunne and Rodrigo Primo for the patches.
- Various housekeeping, including improvements to the tests and documentation.
- Thanks to Dan Wallis, Rodrigo Primo and Juliette Reinders Folmer for their contributions.
Other
- The latest PHP_CodeSniffer XSD file is now available via the following permalink: https://schema.phpcodesniffer.com/phpcs.xsd. #1094
Older XSD files can be referenced via permalinks based on their minor:https://schema.phpcodesniffer.com/#.#/phpcs.xsd
. - The GPG signature for the PHAR files has been rotated. The new fingerprint is: D91D86963AF3A29B6520462297B02DD8E5071466.
Statistics
Closed: 3 issues
Merged: 24 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!
4.0.0beta1
Added
- Files without extension can now be scanned if the path is passed in directly. #2916
- Previously, files without extension would always be ignored.
- Now, files with no extension are checked if explicitly passed on the command line or specified in a ruleset.
- Files without extension will still be ignored when scanning directories recursively.
- Support for extending a default value for an array property on a sniff from an XML ruleset file. #15
- Previously, using
extend="true"
on an property tag for setting an array value could already extend a property value set elsewhere in an (inluded) ruleset. - Now, you can also add to (extend) a default value as set on the sniff itself.
- Note: the property default value and the values set via the ruleset will be merged.
- This also means that for associative arrays, you can redefine the value for a particular array key.
- For numerically indexed arrays, this means the array will be renumbered. Keep this in mind if the numeric indexes hold meaning.
- Previously, using
- Added support for PHP 8.4 properties in interfaces to File::getMemberProperties(). #2455
- Note: properties in interfaces is not fully supported yet, it is just this one method which handles them correctly at this moment.
Tokens::NAME_TOKENS
containing an array with the tokens used for identifier names. #3041- New sniff
Generic.WhiteSpace.GotoTargetSpacing
to enforce no space between the label of agoto
target and the colon following it. #1026 - An error message is now displayed if no files were checked during a run. #1595
- This occurs when all of the specified files matched exclusion rules, or none matched filtering rules.
- An error will be shown when attempting to change an unchangable PHP ini setting using
-d option[=value]
or via the ruleset with<ini name=...>
. #416- Previously, this was silently ignored.
- Attempting to change non-existent ini settings (typo, extension not loaded) will continue to be silently ignored.
Changed
- The minimum required PHP version has changed from 5.4.0 to 7.2.0.
- The default coding standard has changed from
PEAR
toPSR12
. - Both
phpcs
as well asphpcbf
will now exit with exit code 0 if no issues were found/remain after fixing. #184- Non auto-fixable issues can be ignored for the exit code determination by setting the new
ignore_non_auto_fixable_on_exit
config flag to1
. - For full details on the new exit codes, please refer to the Wiki "Advanced Usage" page.
- Non auto-fixable issues can be ignored for the exit code determination by setting the new
- Composer installs no longer include any test files. #1908
- The test framework files will still be included to allow for use by external standards.
- All status, debug, and progress output is now sent to STDERR instead of STDOUT. #1612
- Only report output now goes through STDOUT. As a result of this, piping output to a file will now only include report output.
- Pipe both STDERR and STDOUT to the same file to capture the entire output of the run.
- The
--report-file
functionality remains untouched. - With this change in place, timing and memory consumption stats will now be displayed more often as this will no longer interfere with reports.
- Only report output now goes through STDOUT. As a result of this, piping output to a file will now only include report output.
- The
--extensions
command line argument no longer accepts the tokenizer along with the extension. #2448- Previously, you would check
.module
files as PHP files using--extensions=module/php
. - Now, you use
--extensions=module
.
- Previously, you would check
- When processing rulesets,
<config>
directives will be applied based on the nesting level of the ruleset. #2197- Previously, it was not possible to overrule a
<config>
directive set in an included ruleset from the "root" ruleset. - Now,
<config>
directives set in the "root" ruleset will always "win" over directives in included rulesets. - When two included rulesets at the same nesting level both set the same directive, the value from the last included ruleset "wins" (= same as before).
- Previously, it was not possible to overrule a
- When processing rulesets,
<arg>
directives will be applied based on the nesting level of the ruleset. #2395, #2597, #2602- Previously, it was not possible to overrule a
<arg>
directive set in an included ruleset from the "root" ruleset. - Now,
<arg>
directives set in the "root" ruleset will always "win" over directives in included rulesets. - When two included rulesets at the same nesting level both set the same directive, the value from the first included ruleset "wins" (= same as before).
- Previously, it was not possible to overrule a
- Internal errors will no longer be suppressed when the
--sniffs
CLI argument is used. #98 - The
File::getDeclarationName()
method will no longer acceptT_ANON_CLASS
orT_CLOSURE
tokens. #3766- A
RuntimeException
will be thrown if these tokens are passed.
- A
- The
File::getDeclarationName()
method will now always return a string (or throw an Exception). #1007- Previously, the method would return
null
if the name could not be determined, like during live coding.
Now it will return an empty string in those situations.
- Previously, the method would return
- The
File::getMemberProperties()
method will no longer add warnings about possible parse errors. #2455- This means the
Internal.ParseError.InterfaceHasMemberVar
and theInternal.ParseError.EnumHasMemberVar
error codes have been removed. - The method will now throw a "$stackPtr is not a class member var"
RuntimeException
for properties declared in enums (parse error). - Properties declared in interfaces will be analyzed like all other properties, as these are allowed since PHP 8.4.
- This means the
- None of the included sniffs will warn about possible parse errors any more. #2455
- This improves the experience when the file is being checked inside an editor during live coding.
- If you want to detect parse errors, use the
Generic.PHP.Syntax
sniff or a dedicated linter instead.
- The PEAR + PSR2 FunctionCallSignature sniffs will now also examine anonymous class instantiations with parameters. #47
- The error code
Squiz.Classes.ValidClassName.NotCamelCaps
has been changed toSquiz.Classes.ValidClassName.NotPascalCase
. #2046- This reflects that the sniff is actually checking for
ClassName
and notclassName
.
- This reflects that the sniff is actually checking for
- The error code
Squiz.PHP.Heredoc.NotAllowed
has been replaced bySquiz.PHP.Heredoc.HeredocNotAllowed
andSquiz.PHP.Heredoc.NowdocNotAllowed
. #2318- This allows for forbidding either heredocs or nowdocs without forbidding both.
- The
PSR12.Files.FileHeader
sniff now has more modular error codes to allow for more selectively applying the rules. #2729 #3453- The
PSR12.Files.FileHeader.SpacingAfterBlock
error code is replaced by:PSR12.Files.FileHeader.SpacingAfterTagBlock
PSR12.Files.FileHeader.SpacingAfterDocblockBlock
PSR12.Files.FileHeader.SpacingAfterDeclareBlock
PSR12.Files.FileHeader.SpacingAfterNamespaceBlock
PSR12.Files.FileHeader.SpacingAfterUseBlock
PSR12.Files.FileHeader.SpacingAfterUseFunctionBlock
PSR12.Files.FileHeader.SpacingAfterUseConstBlock
- The
PSR12.Files.FileHeader.SpacingInsideBlock
error code is replaced by:PSR12.Files.FileHeader.SpacingInsideUseBlock
PSR12.Files.FileHeader.SpacingInsideUseFunctionBlock
PSR12.Files.FileHeader.SpacingInsideUseConstBlock
- The
- The error code
Squiz.Commenting.VariableComment.TagNotAllowed
has been replaced by a dynamicSquiz.Commenting.VariableComment.[TagName]TagNotAllowed
error code. #1039- This allows for selectively allowing specific tags by excluding the error code for that tag.
- Example: to allow
@link
tags in property docblocks, exclude theSquiz.Commenting.VariableComment.LinkTagNotAllowed
error code.
- The following sniffs have received performance related improvements:
- PEAR.NamingConventions.ValidVariableName
- PSR2.Classes.PropertyDeclaration
- Squiz.Commenting.VariableComment
- Squiz.Scope.MemberVarScope
- Squiz.WhiteSpace.MemberVarSpacing
- These sniffs will no longer listen to non-variable tokens, nor for variables tokens outside of OO context. #374
External sniffs which extend one of these sniffs may need adjustment if they want to retain the old behaviour.
- PHPCS now uses the PHP >= 8.0 native method for tokenizing (namespaced) identifier names. #3041
- Before PHP 8.0, PHP would tokenize namespaced names using
T_STRING
andT_NS_SEPARATOR
. - From PHP 8.0, PHP uses the tokens
T_NAME_FULLY_QUALIFIED
,T_NAME_RELATIVE
, andT_NAME_QUALIFIED
instead. - PHPCS now uses these new PHP 8.0 tokens no matter what version of PHP is being used to run PHPCS.
...
- Before PHP 8.0, PHP would tokenize namespaced names using
3.13.0 - 2025-05-11
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!
3.12.2 - 2025-04-13
Added
- Added support for PHP 8.4
final
properties to the following sniffs:- Generic.PHP.LowerCaseConstant #948
- Generic.PHP.UpperCaseConstant #948
- Squiz.Commenting.DocCommentAlignment #951
- Squiz.Commenting.VariableComment #949
- Thanks to Juliette Reinders Folmer for the patches.
Changed
- Tokenizer/PHP: a PHP open tag at the very end of a file will now always be tokenized as T_OPEN_TAG, independently of the PHP version. #937
- Previously, a PHP open tag at the end of a file was not tokenized as an open tag on PHP < 7.4 and the tokenization would depend on the
short_open_tag
setting. - Thanks to Juliette Reinders Folmer for the patch.
- Previously, a PHP open tag at the end of a file was not tokenized as an open tag on PHP < 7.4 and the tokenization would depend on the
- PEAR.Commenting.FunctionComment: improved message for "blank lines between docblock and declaration" check. #830
- The documentation for the following sniffs has been improved:
- Generic.Functions.OpeningFunctionBraceBsdAllman
- Generic.Functions.OpeningFunctionBraceKernighanRitchie
- Generic.WhiteSpace.LanguageConstructSpacing
- Thanks to Rodrigo Primo for the patches.
- Various housekeeping, including improvements to the tests and documentation.
- Thanks to Rodrigo Primo and Juliette Reinders Folmer for their contributions.
Fixed
- Fixed bug #830 : PEAR.Commenting.FunctionComment will no longer remove blank lines within attributes.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #929 : Generic.PHP.ForbiddenFunctions: prevent false positives/negatives for code interlaced with comments.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #934 : Generic.PHP.LowerCaseConstant and Generic.PHP.UpperCaseConstant will now correctly ignore DNF types for properties.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #936 : Squiz.Commenting.FunctionCommentThrowTag: sniff would bow out when function has attributes attached, leading to false negatives.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #940 : Squiz.Commenting.VariableComment: false positive for missing docblock for properties using DNF types.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #944 : Squiz.Commenting.FunctionComment did not support DNF/intersection types in
@param
tags.- Thanks to Jeffrey Angenent for the patch.
- Fixed bug #945 : Squiz.WhiteSpace.FunctionSpacing would get confused when there are two docblocks above a function declaration.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #947 : Squiz.Commenting.FunctionCommentThrowTag: prevent false positives/negatives for code interlaced with comments.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #951 : Squiz.Commenting.DocCommentAlignment did not examine docblocks for
final
classes.- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #955 : Potential race condition, leading to a fatal error, when both the
Diff
+ theCode
reports are requested and caching is on.- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #956 : Generic.WhiteSpace.ScopeIndent: undefined array index notice when running in debug mode.
- Thanks to Juliette Reinders Folmer for the patch.
Other
- PHP_CodeSniffer 4.0 is coming soon! Interested in a sneak peek ? Join the live stream at any time on April 14, 15, 17 or 18.
Read the open invitation (#924) for all the details.
New Contributors
The PHP_CodeSniffer project is happy to welcome the following new contributors:
@devfrey
Statistics
Closed: 1 issues
Merged: 36 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!
3.12.1 - 2025-04-04
Added
- Documentation for the following sniffs:
- Squiz.Commenting.BlockComment
- Thanks to Colin Stewart for the patch.
Changed
- Generic.WhiteSpace.HereNowdocIdentifierSpacing: improved error message text.
- Thanks to Juliette Reinders Folmer for the patch.
- Various housekeeping, including improvements to the tests and documentation.
- Thanks to Rodrigo Primo and Juliette Reinders Folmer for their contributions.
Deprecated
- The
Generic.Functions.CallTimePassByReference
sniff. See #921.- This sniff will be removed in version 4.0.0.
Fixed
- Fixed bug #906 : Fixer: prevent
InvalidArgumentException
s when displaying verbose information.- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #907 : Tokenizer/PHP: tokenization of tokens related to union, intersection and DNF types in combination with PHP 8.4 final properties.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #908 : Tokenizer/PHP: tokenization of
?
in nullable types for readonly properties.- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #916 : Tokenizer/PHP:
goto
was not recognized as a terminating statement for a case/default in a switch control structure.- Thanks to Juliette Reinders Folmer for the patch.
Other
- PHP_CodeSniffer 4.0 is coming soon! Interested in a sneak peek ? Join the live stream at any time on April 14, 15, 17 or 18.
Read the open invitation (#924) for all the details.
New Contributors
The PHP_CodeSniffer project is happy to welcome the following new contributors:
@costdev
Statistics
Closed: 0 issues
Merged: 24 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!