4.0.2 - 2026-08-06 #1477
jrfnl
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is a security release and all users are advised to update their install(s) as soon as possible.
The security issue only affects users of the
Gitblame,HgblameorSvnblamereport(s).Added
(void)cast. PHP 8.5 | Tokenizer/PHP: polyfill the (void) cast #1325The
T_VOID_CASTtoken has been added to theTokens::CAST_TOKENSarray.suggestsection to thecomposer.jsonfile to inform users about the recommendediconvandpcntlPHP extensions. Add suggest section to composer.json for recommended extensions #1388Changed
libxmlis a required PHP extension. Composer: clarify that the PHPlibxmlextension is required #1409$thisin static closures. Squiz/StaticThisUsage: improve handling of anonymous functions #1377WrongOpener*) has been made more informative. PSR2 WrongOpenercase with colon and bracket is unclear #1358. Fixes PSR2.ControlStructures.SwitchDeclaration.WrongOpenercase with colon and bracket is unclear #1322.PEAR.Functions.FunctionDeclarationPEAR/FunctionDeclarationSniff: use placeholders in error messages #1445CloseBracketLineerror message now exposes 1 data value (previously 0).EmptyLineerror message now exposes 1 data value (previously 0).Indenterror message now exposes 3 data values (previously 2).PSR12.Classes.AnonClassDeclarationandSquiz.Functions.MultiLineFunctionDeclarationsniffs.PSR2.Classes.ClassDeclarationPSR2/ClassDeclarationSniff: use placeholders in error messages #1446ExtendsLineandImplementsLineerror messages now expose 3 data values (previously 1).SpaceBeforeExtendsandSpaceBeforeImplementserror messages now expose 2 data values (previously 1).PSR12.Classes.AnonClassDeclarationandSquiz.Classes.ClassDeclarationsniffs.PSR2.ControlStructures.SwitchDeclarationPSR2/SwitchDeclarationSniff: use placeholders in error messages #1447defaultNotLowerandcaseNotLowererror messages now expose 3 data values (previously 2).SpaceBeforeColonDEFAULTandSpaceBeforeColonCASEerror messages now expose 1 data value (previously 0).BodyOnNextLineDEFAULTandBodyOnNextLineCASEerror messages now expose 1 data value (previously 0).WrongOpenerdefaultandWrongOpenercaseerror messages now expose 1 data value (previously 0).Squiz.ControlStructures.SwitchDeclarationSquiz/SwitchDeclarationSniff: use placeholders in error messages #1449CaseNotLowerandDefaultNotLowererror messages now expose 3 data values (previously 2).CaseIndentandDefaultIndenterror messages now expose 2 data values (previously 0).SpaceBeforeColonCaseandSpaceBeforeColonDefaulterror messages now expose 1 data value (previously 0).BreakIndenterror message now exposes 1 data value (previously 0).SpacingAfterCaseandSpacingAfterDefaulterror messages now expose 1 data value (previously 0).Squiz.Functions.FunctionDeclarationArgumentSpacingSquiz/FunctionDeclarationArgumentSpacing: use placeholders in error messages #1452SpaceBeforeEqualserror message now exposes 3 data values (previously 2).SpaceAfterEqualserror message now exposes 3 data values (previously 2).Squiz.Functions.MultiLineFunctionDeclarationSquiz/MultiLineFunctionDeclaration: use placeholders in error messages #1453FirstParamSpacingandUseFirstParamSpacingerror messages now expose 1 data value (previously 0).OneParamPerLineandUseOneParamPerLineerror messages now expose 1 data value (previously 0).PSR12.Classes.AnonClassDeclarationsniff.Fixed
Gitblame,HgblameorSvnblamereport(s) would process a file whose name contains shell metacharacters. Reports/*blame: properly escape file name #1473Fullreport, or any of the other non-*blame reports, are not affected.Generic.Strings.UnnecessaryHeredocincorrectly converts tabs into spaces in heredoc #1320: Generic.Strings.UnnecessaryHeredoc: the fixer could incidentally change tab indentation to space indentation in select lines in the heredoc body.PSR12.Functions.ReturnTypeDeclaration#1354: PSR12.Functions.ReturnTypeDeclaration: prevent an "Undefined array key" warning if the code under scan contains a parse error.$thisin non-static closures nested in OO methods.PEAR.Functions.FunctionDeclarationgets confused by multi-line block comments inside a function's argument list #1368: PEAR.Functions.FunctionDeclaration: the indentation for subsequent lines in multi-line block comments within a multi-line function signature, would be incorrectly determined, leading to false positives and resulting in a fixer conflict when runningphpcbf.Squiz.Functions.MultiLineFunctionDeclarationsniff.constname is the last non-empty token in a file #1451: Tokenizer/PHP: prevent an "Undefined array key" warning during live coding when a file ends on the name in a constant declaration.Other
New Contributors
The PHP_CodeSniffer project is happy to welcome the following new contributors:
@bigdevlarry, @Faze-up, @jrchamp, @lazerg, @morozov, @ntdiary, @SAY-5
Statistics
Closed: 10 issues
Merged: 33 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!
This discussion was created from the release 4.0.2 - 2026-08-06.
All reactions