Update dependency squizlabs/php_codesniffer to v3.13.5
Note: This PR body was truncated due to platform limits.
This PR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| squizlabs/php_codesniffer | 3.7.1 β 3.13.5 |
Release Notes
PHPCSStandards/PHP_CodeSniffer (squizlabs/php_codesniffer)
v3.13.5: - 2025-11-04
Added
- Runtime support for PHP 8.5. All known PHP 8.5 deprecation notices have been fixed.
- Syntax support for new PHP 8.5 features will follow in a future release.
- If you find any PHP 8.5 deprecation notices which were missed, please report them.
Changed
- Various housekeeping, including improvements to the tests and documentation.
- Thanks to Rodrigo Primo and Juliette Reinders Folmer for their contributions.
Fixed
- Fixed bug #β1216: Tokenizer/PHP: added more defensive coding to prevent PHP 8.5 "Using null as an array offset" deprecation notices.
- Thanks to Andrew Lyons for the patch.
- Fixed bug #β1279: Tokenizer/PHP: on PHP < 8.0, an unclosed attribute (parse error) could end up removing some tokens from the token stream.
- This could lead to false positives and false negative from sniffs, but could also lead to incorrect fixes being made mangling the file under scan.
- Thanks to Juliette Reinders Folmer for the patch.
Other
- Please be aware that the
masterbranch has been renamed to3.xand the default branch has changed to the4.xbranch.- 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.
New Contributors
The PHP_CodeSniffer project is happy to welcome the following new contributors: @βandrewnicols
Statistics
Closed: 2 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!
v3.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!
v3.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
abstractproperties. #β1183- The
File::getMemberProperties()method now also supportsabstractproperties through a newis_abstractarray index in the return value. #β1184 - Additionally, the following sniffs have been updated to support
abstractproperties: - 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/dieis 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/nullwill 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
AbstractAfterVisibilityerror 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 :
--paralleloption 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
--parallelscanning 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. :tada:
- 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.
- 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!
v3.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!
v3.13.1: - 2025-06-13
Added
- Added support for PHP 8.4 properties with asymmetric visibility to File::getMemberProperties() through a new
set_scopearray 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_visibilityandset_visibility_tokenarray 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
AvizKeywordOrdererror 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
SpacingAfterSetVisibilityerror 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:
D91D869.
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!
v3.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
finalproperties 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
gotolanguage construct keyword. #β917- Thanks to Juliette Reinders Folmer for the patch.
- The PSR2.Classes.PropertyDeclaration will now check that the
finalmodifier keyword is placed before a visibility keyword. #β950- Errors will be reported via a new
FinalAfterVisibilityerror code. - Thanks to Juliette Reinders Folmer for the patch.
- Errors will be reported via a new
- Improved Help information about the
--reportsCLI 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\Sniffinterface. #β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!
v3.12.2: - 2025-04-13
Added
- Added support for PHP 8.4
finalproperties 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_tagsetting. - 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
@paramtags.- 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
finalclasses.- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β955 : Potential race condition, leading to a fatal error, when both the
Diff+ theCodereports 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!
v3.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.CallTimePassByReferencesniff. See #β921.- This sniff will be removed in version 4.0.0.
Fixed
- Fixed bug #β906 : Fixer: prevent
InvalidArgumentExceptions 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:
gotowas 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!
v3.12.0: - 2025-03-18
Added
- Added support for PHP 8.4 final properties to File::getMemberProperties() through a new
is_finalarray index in the return value. #β834- Thanks to Daniel Scherzer for the patch.
- Generators/HTML: each section title now has a unique anchor link, which can be copied when hovering over a title. #β859
- This should make sharing a link to a specific section of the documentation more straight-forward.
- Thanks to Juliette Reinders Folmer for the patch.
- Documentation for the following sniffs:
- Squiz.Classes.ClassFileName
- Squiz.Classes.ValidClassName
- Thanks to Brian Dunne for the patches.
Changed
- PHPCBF: the messaging when no fixable errors are found will now distinguish between "No violations" (at all) versus "No fixable errors". #β806
- Thanks to Peter Wilson for the patch.
- The
-h(Help) option now contains a more extensive list of "config" options which can be set. #β809- Thanks to Juliette Reinders Folmer for the patch.
- Improved error message when invalid sniff codes are supplied to
--sniffsor--excludecommand line arguments. #β344- Thanks to Dan Wallis for the patch.
- Improved error message when an invalid generator name is supplied to the
--generatorcommand line argument. #β709, #β771- The generator name will now also always be handled case-insensitively, independently of the OS used.
- Thanks to Rodrigo Primo for the patch.
- The user will be shown an informative error message for sniffs missing one of the required methods. #β873
- Previously this would result in a fatal error.
- Thanks to Juliette Reinders Folmer for the patch.
- Ruleset processing will now be allowed to run to its conclusion - barring critical errors - before displaying all ruleset errors in one go. #β857
- Previously an error in a ruleset would cause PHPCS to exit immediately and show only one error at a time.
- Thanks to Juliette Reinders Folmer for the patch.
- Generators: XML documentation files which don't contain any actual documentation will now silently be ignored. #β755
- Thanks to Juliette Reinders Folmer for the patch.
- Generators: when the
titleattribute is missing, the documentation generation will now fall back to the sniff name as the title. #β820- Thanks to Juliette Reinders Folmer for the patch.
- Generators: cleaner output based on the elements of the documentation which are available. #β819, #β821
- Thanks to Juliette Reinders Folmer for the patch.
- Generators/HTML: improved display of code tables by using semantic HTML. #β854
- Thanks to Juliette Reinders Folmer for the patch.
- Squiz.Classes.ClassFileName: recommend changing the file name instead of changing the class name. #β845
- This prevents unactionable recommendations due to the file name not translating to a valid PHP symbol name.
- Thanks to Juliette Reinders Folmer for the patch.
- Squiz.Functions.FunctionDeclarationArgumentSpacing: incorrect spacing after a comma followed by a promoted property has an improved error message and will now be flagged with the
SpacingBeforePropertyModifierorNoSpaceBeforePropertyModifiererror codes. #β792- This was previously already flagged, but using either the
SpacingBeforeHintorNoSpaceBeforeHinterror code, which was misleading. - Thanks to Juliette Reinders Folmer for the patch.
- This was previously already flagged, but using either the
- Squiz.Functions.FunctionDeclarationArgumentSpacing: the sniff will now also check the spacing after property modifiers for promoted properties in constructor methods. #β792
- Thanks to Juliette Reinders Folmer for the patch.
- Squiz.WhiteSpace.ScopeKeywordSpacing: the sniff will now also check the spacing after the
finalandabstractmodifier keywords. #β604- Thanks to Klaus Purer for the patch.
- The following sniff(s) have received efficiency improvements:
- Squiz.WhiteSpace.ScopeKeywordSpacing
- Thanks to Juliette Reinders Folmer for the patches.
- Incorrectly set inline properties (in test case files) will be silently ignored again. #β884
- This removes the
Internal.PropertyDoesNotExisterror code. - Thanks to Juliette Reinders Folmer for the patch.
- This removes the
- The AbstractMethodUnitTest class will now flag duplicate test case markers in a test case file. #β773
- Thanks to Juliette Reinders Folmer for the patch.
- Various housekeeping, including improvements to the tests and documentation.
- Thanks to Asis Pattisahusiwa, Dan Wallis, Rodrigo Primo and Juliette Reinders Folmer for their contributions.
Deprecated
All deprecation are slated for removal in PHP_CodeSniffer 4.0.
- Support for sniffs not implementing the PHPCS
Sniffinterface. See #β694.- Thanks to Juliette Reinders Folmer for the patch.
- Support for including sniffs which don't comply with the PHPCS naming conventions (by referencing the sniff file directly). See #β689.
- Thanks to Juliette Reinders Folmer for the patch.
- Support for external standards named "Internal". See #β799.
- Thanks to Juliette Reinders Folmer for the patch.
- The following Generator methods are now (soft) deprecated. See #β755:
-
PHP_CodeSniffer\Generators\Text::printTitle()in favour ofPHP_CodeSniffer\Generators\Text::getFormattedTitle() -
PHP_CodeSniffer\Generators\Text::printTextBlock()in favour ofPHP_CodeSniffer\Generators\Text::getFormattedTextBlock() -
PHP_CodeSniffer\Generators\Text::printCodeComparisonBlock()in favour ofPHP_CodeSniffer\Generators\Text::getFormattedCodeComparisonBlock() -
PHP_CodeSniffer\Generators\Markdown::printHeader()in favour ofPHP_CodeSniffer\Generators\Markdown::getFormattedHeader() -
PHP_CodeSniffer\Generators\Markdown::printFooter()in favour ofPHP_CodeSniffer\Generators\Markdown::getFormattedFooter() -
PHP_CodeSniffer\Generators\Markdown::printTextBlock()in favour ofPHP_CodeSniffer\Generators\Markdown::getFormattedTextBlock() -
PHP_CodeSniffer\Generators\Markdown::printCodeComparisonBlock()in favour ofPHP_CodeSniffer\Generators\Markdown::getFormattedCodeComparisonBlock() -
PHP_CodeSniffer\Generators\HTML::printHeader()in favour ofPHP_CodeSniffer\Generators\HTML::getFormattedHeader() -
PHP_CodeSniffer\Generators\HTML::printToc()in favour ofPHP_CodeSniffer\Generators\HTML::getFormattedToc() -
PHP_CodeSniffer\Generators\HTML::printFooter()in favour ofPHP_CodeSniffer\Generators\HTML::getFormattedFooter() -
PHP_CodeSniffer\Generators\HTML::printTextBlock()in favour ofPHP_CodeSniffer\Generators\HTML::getFormattedTextBlock() -
PHP_CodeSniffer\Generators\HTML::printCodeComparisonBlock()in favour ofPHP_CodeSniffer\Generators\HTML::getFormattedCodeComparisonBlock() - Thanks to Juliette Reinders Folmer for the patch.
-
Fixed
- Fixed bug #β794 : Generators: prevent fatal error when the XML documentation does not comply with the expected format.
- It is recommended to validate XML documentation files against the XSD file: https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β814 : Generic.NamingConventions.ConstructorName: prevent potential fatal errors during live coding.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β816 : File::getDeclarationName(): prevent incorrect result for unfinished closures during live coding.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β817 : Squiz.Classes.ValidClassName: ignore comments when determining the name to be validated.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β825 : Squiz.Classes.ClassDeclaration: false positives when the next thing after a class was a function with an attribute attached.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β826 : Squiz.WhiteSpace.FunctionSpacing: prevent incorrect some results when attributes are attached to a function.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β827 : PEAR.Functions.FunctionDeclaration: fixer conflict over an unfinished closure during live coding.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β828 : Squiz.WhiteSpace.MemberVarSpacing: allow for
readonlyproperties.- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β832 : Squiz.WhiteSpace.MemberVarSpacing: prevent potential fixer conflict during live coding.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β833 : Squiz.PHP.EmbeddedPhp: fixer conflict when a PHP open tag for a multi-line snippet is found on the same line as a single-line embedded PHP snippet.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β833 : Squiz.PHP.EmbeddedPhp: incorrect indent calculation in certain specific situations.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β835 : Generic.PHP.DisallowShortOpenTag: don't act on parse errors.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β838 : Squiz.PHP.EmbeddedPhp: no new line before close tag was incorrectly enforced when a preceding OO construct or function had a trailing comment after the close curly.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β840 : Squiz.WhiteSpace.MemberVarSpacing: more accurate reporting on blank lines in the property "pre-amble" (i.e. docblock, attributes).
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β845 : Squiz.Classes.ClassFileName: don't throw an incorrect error for an unfinished OO declaration during live coding.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β865 : Setting an array property to an empty array from an XML ruleset now works correctly.
- Previously, the property value would be set to
[0 => '']. - Thanks to Juliette Reinders Folmer for the patch.
- Previously, the property value would be set to
- Fixed bug #β866 : Squiz.WhiteSpace.FunctionOpeningBraceSpace: XML docs were not accessible due to an issue with the file name.
- Thanks to Juliette Reinders Folmer for the patch.
Other
- A new wiki page is available to clarify the difference between a project ruleset and an external standard.
- This wiki page also contains detailed information about the naming conventions external standards must comply with.
- A new XMLLint validate action runner is available which can be used in CI to validate rulesets for PHP_CodeSniffer against the XSD.
New Contributors
The PHP_CodeSniffer project is happy to welcome the following new contributors: @βasispts, @βbraindawg, @βDanielEScherzer, @βpeterwilsoncc
Statistics
Closed: 5 issues Merged: 74 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!
v3.11.3: - 2025-01-23
Changed
- Generic.ControlStructures.InlineControlStructure no longer unnecessarily listens for T_SWITCH tokens. #β595
- Thanks to Rodrigo Primo for the patch.
- Squiz.Functions.FunctionDeclarationArgumentSpacing: improvements to error message for
SpaceBeforeCommaerror. #β783- Thanks to Juliette Reinders Folmer for the patch.
- The following sniff(s) have received efficiency improvements:
- Squiz.Functions.FunctionDeclarationArgumentSpacing
- Thanks to Dan Wallis and Juliette Reinders Folmer for the patches.
- Various housekeeping, including improvements to the tests and documentation.
- Thanks to MichaΕ Bundyra, Rodrigo Primo and Juliette Reinders Folmer for their contributions.
Fixed
- Fixed bug #β620 : Squiz.Functions.FunctionDeclarationArgumentSpacing: newlines after type will now be handled by the fixer. This also prevents a potential fixer conflict.
- Thanks to Dan Wallis for the patch.
- Fixed bug #β782 : Tokenizer/PHP: prevent an "Undefined array key" notice during live coding for unfinished arrow functions.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β783 : Squiz.Functions.FunctionDeclarationArgumentSpacing: new line after reference token was not flagged nor fixed.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β783 : Squiz.Functions.FunctionDeclarationArgumentSpacing: new line after variadic token was not flagged nor fixed.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β783 : Squiz.Functions.FunctionDeclarationArgumentSpacing: new line before/after the equal sign for default values was not flagged nor fixed when
equalsSpacingwas set to0.- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β783 : Squiz.Functions.FunctionDeclarationArgumentSpacing: fixer conflict when a new line is found before/after the equal sign for default values and
equalsSpacingwas set to1.- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β783 : Squiz.Functions.FunctionDeclarationArgumentSpacing: fixer for spacing before/after equal sign could inadvertently remove comment.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β783 : Squiz.Functions.FunctionDeclarationArgumentSpacing: fixer will now handle comments between the end of a parameter and a comma more cleanly.
- Thanks to Juliette Reinders Folmer for the patch.
- Fixed bug #β784 : Squiz.WhiteSpace.FunctionSpacing: prevent fixer conflict when a multi-line docblock would start on the same line as the function close curly being examined.
- Thanks to Klaus Purer for the patch
Statistics
Closed: 0 issues Merged: 14 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!
v3.11.2: - 2024-12-11
Changed
- Generators/HTML + Markdown: the output will now be empty (no page header/footer) when there are no docs to display. #β687
- This is in line with the Text Generator which already didn't produce output if there are no docs.
- Thanks to Juliette Reinders Folmer for the patch.
- Generators/HTML: only display a Table of Contents when there is more than one sniff with documentation. #β697
- Thanks to Juliette Reinders Folmer for the patch.
- Generators/HTML: improved handling of line breaks in
<standard>blocks. #β723- Thanks to Juliette Reinders Folmer for the patch.
- Generators/Markdown: improved compatibility with the variety of available markdown parsers. #β722
- Thanks to Juliette Reinders Folmer for the patch.
- Generators/Markdown: improved handling of line breaks in
<standard>blocks. #β737- This prevents additional paragraphs from being displayed as code blocks.
- Thanks to Juliette Reinders Folmer for the patch.
- Generic.NamingConventions.UpperCaseConstantName: the exact token containing the non-uppercase constant name will now be identified with more accuracy. #β665
- Thanks to Rodrigo Primo for the patch.
- Generic.Functions.OpeningFunctionBraceKernighanRitchie: minor improvement to the error message wording. #β736
- 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.
Fixed
- Fixed bug #β527 : Squiz.Arrays.ArrayDeclaration: short lists within a foreach condition should be ignored.
- Thanks to Rodrigo Primo for the patch.
- Fixed bug #β665 : Generic.NamingConventions.UpperCaseConstantName: false positives and false negatives when code uses unconventional spacing and comments when calling
define().- Thanks to Rodrigo Primo for the patch.
- Fixed bug #β665 : Generic.NamingConventions.UpperCaseConstantName: false positive when a constant named
DEFINEis encountered.- Thanks to Rodrigo Primo for the patch.
- Fixed bug #β665 : Generic.NamingConventions.UpperC
Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.