Skip to content

Update dependency squizlabs/php_codesniffer to v4 [SECURITY] - #15

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/packagist-squizlabs-php_codesniffer-vulnerability
Open

Update dependency squizlabs/php_codesniffer to v4 [SECURITY]#15
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/packagist-squizlabs-php_codesniffer-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
squizlabs/php_codesniffer ~2.6~4.0 age confidence

PHP_CodeSniffer gitblame report command injection via crafted filename

CVE-2026-67434 / GHSA-hmqg-cxww-wqhq

More information

Details

Impact

PHP_CodeSniffer versions before v3.13.6 and v4.0.2 contain a command injection vulnerability in the code creating the Gitblame, Hgblame and Svnblame report(s).

As a result, running PHP_CodeSniffer over untrusted files, for example, in a CI pipeline that scans pull requests, or on a developer machine reviewing third-party code, could result in attacker-controlled shell commands being executed when the Gitblame, Hgblame or Svnblame report(s) would process a file whose name contains shell metacharacters.

  • Users using the default Full report, or any of the other non-*blame reports, are not affected.
  • Users on a runtime platform which does not allow filenames to contain shell metacharacters, such as " and ;, are not affected.
Patched versions

The issue has been fixed in PHP_CodeSniffer v3.13.6 and v4.0.2. We recommend all users upgrade to these versions at their earliest convenience.

Workaround

Users of PHP_CodeSniffer who cannot upgrade immediately should ensure they do not use the Gitblame, Hgblame or the Svnblame reports when scanning untrusted code.

This is especially relevant for CI jobs, pre-commit or review tooling, automated review services, and any service that scans untrusted repositories or uploaded source trees.

Credits

Many thanks to both @​Faze-up and @​edorian for responsibly disclosing this vulnerability.

How can I report a security bug?

Please report security vulnerabilities privately via the "Security and quality" tab on the PHP_CodeSniffer repository.

Severity

  • CVSS Score: 7.3 / 10 (High)
  • Vector String: CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

PHPCSStandards/PHP_CodeSniffer (squizlabs/php_codesniffer)

v4.0.4: - 2026-08-06

Compare Source

The 4.0.2 release, the 4.0.3 and the 4.0.4 release are 100% the same (aside from the version number), there was just a slight snafu in the release publication on GitHub (missing PHAR assets). Sorry for the confusion.

v4.0.2: - 2026-08-06

Compare Source

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, Hgblame or Svnblame report(s).

Added
  • Tokenizer support for the PHP 8.5 (void) cast. #​1325
    The T_VOID_CAST token has been added to the Tokens::CAST_TOKENS array.
  • suggest section to the composer.json file to inform users about the recommended iconv and pcntl PHP extensions. #​1388
Changed
  • Clarified that libxml is a required PHP extension. #​1409
  • Squiz.Scope.StaticThisUsage: the sniff will now also search for the use of $this in static closures. #​1377
  • The Generic.PHP.LowerCaseKeyword, Generic.WhiteSpace.LanguageConstructSpacing and Squiz.Functions.FunctionDeclarationArgumentSpacing sniffs no longer embed UTF-8 middot characters for spaces in error messages. #​1379, #​1389 Fixes Squiz/#​2652.
  • PSR2.ControlStructures.SwitchDeclaration: the error message for the use of colon + curly braces (WrongOpener*) has been made more informative. #​1358. Fixes #​1322.
  • The error messages for the following sniffs have been improved by exposing more data placeholders:
    • PEAR.Functions.FunctionDeclaration #​1445
      • The CloseBracketLine error message now exposes 1 data value (previously 0).
      • The EmptyLine error message now exposes 1 data value (previously 0).
      • The Indent error message now exposes 3 data values (previously 2).
      • These changes also affect the same error codes for the PSR12.Classes.AnonClassDeclaration and Squiz.Functions.MultiLineFunctionDeclaration sniffs.
    • PSR2.Classes.ClassDeclaration #​1446
      • The ExtendsLine and ImplementsLine error messages now expose 3 data values (previously 1).
      • The SpaceBeforeExtends and SpaceBeforeImplements error messages now expose 2 data values (previously 1).
      • These changes also affect the same error codes for the PSR12.Classes.AnonClassDeclaration and Squiz.Classes.ClassDeclaration sniffs.
    • PSR2.ControlStructures.SwitchDeclaration #​1447
      • The defaultNotLower and caseNotLower error messages now expose 3 data values (previously 2).
      • The SpaceBeforeColonDEFAULT and SpaceBeforeColonCASE error messages now expose 1 data value (previously 0).
      • The BodyOnNextLineDEFAULT and BodyOnNextLineCASE error messages now expose 1 data value (previously 0).
      • The WrongOpenerdefault and WrongOpenercase error messages now expose 1 data value (previously 0).
    • Squiz.ControlStructures.SwitchDeclaration #​1449
      • The CaseNotLower and DefaultNotLower error messages now expose 3 data values (previously 2).
      • The CaseIndent and DefaultIndent error messages now expose 2 data values (previously 0).
      • The SpaceBeforeColonCase and SpaceBeforeColonDefault error messages now expose 1 data value (previously 0).
      • The BreakIndent error message now exposes 1 data value (previously 0).
      • The SpacingAfterCase and SpacingAfterDefault error messages now expose 1 data value (previously 0).
    • Squiz.Functions.FunctionDeclarationArgumentSpacing #​1452
      • The SpaceBeforeEquals error message now exposes 3 data values (previously 2).
      • The SpaceAfterEquals error message now exposes 3 data values (previously 2).
    • Squiz.Functions.MultiLineFunctionDeclaration #​1453
      • The FirstParamSpacing and UseFirstParamSpacing error messages now expose 1 data value (previously 0).
      • The OneParamPerLine and UseOneParamPerLine error messages now expose 1 data value (previously 0).
      • These changes also affect the same error codes for the PSR12.Classes.AnonClassDeclaration sniff.
    • If you have customised the error messages of these sniffs, please review your ruleset after upgrading.
    • Thanks to Zhang WenTao for these patches.
  • The following sniff(s) have received efficiency improvements:
    • PSR2.Classes.PropertyDeclaration
    • Thanks to Jonathan Champ for the patch.
  • The test suite is now more contributor friendly for contributors on MacOS. #​1437
  • Various housekeeping, including improvements to the tests and documentation.
Fixed
  • SECURITY FIX: Running PHP_CodeSniffer over untrusted files, for example, in a CI pipeline that scans pull requests, or on a developer machine reviewing third-party code, could result in attacker-controlled shell commands being executed when the Gitblame, Hgblame or Svnblame report(s) would process a file whose name contains shell metacharacters. #​1473
  • Fixed bug #​1320: Generic.Strings.UnnecessaryHeredoc: the fixer could incidentally change tab indentation to space indentation in select lines in the heredoc body.
  • Fixed bug #​1354: PSR12.Functions.ReturnTypeDeclaration: prevent an "Undefined array key" warning if the code under scan contains a parse error.
  • Fixed bug #​1357: Squiz.Scope.StaticThisUsage: false positive for usage of $this in non-static closures nested in OO methods.
  • Fixed bug #​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 running phpcbf.
    • This also fixes, by extension, the same issue in the Squiz.Functions.MultiLineFunctionDeclaration sniff.
  • Fixed bug #​1418: Tokenizer/PHP: tokenization of an inline else colon after an inline comment could fail and/or throw a "Trying to access array offset on null" warning.
  • Fixed bug #​1435: Generic.Formatting.MultipleStatementAlignment would get into a fixer conflict for multiple assignments within a single statement spanning multiple lines.
    • Same as when the statement would be single-line, alignment of subsequent assignment operators within the same multi-line statement will now be ignored.
    • Thanks to Sergei Morozov for the patch.
  • Fixed bug #​1451: Tokenizer/PHP: prevent an "Undefined array key" warning during live coding when a file ends on the name in a constant declaration.
  • Fixed bug #​1463: Squiz.Functions.FunctionDuplicateArgument: prevent an "Undefined array key" PHP warning when the sniff encounters a function declaration without parentheses (parse error / live coding).
Other
  • The GPG signature for the PHAR files has been rotated. The new fingerprint is: 5CB4F77.

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!

v4.0.1: - 2025-11-10

Compare Source

This release includes all improvements and bugfixes from PHP_CodeSniffer 3.13.5.

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
  • The Squiz.ControlStructures.SwitchDeclaration sniff will now flag a PHP close tag as a "wrong opener" and will auto-fix this by inserting a colon. #​1316
  • Various housekeeping, including improvements to the tests and documentation.
Fixed
  • 4.x regression #​1277: bring back whitespace tolerance in phpcs:ignore comma-separated rule reference lists.
    • Note: this bug did not affect phpcs:disable/phpcs:enable ignore annotations.
  • Fixed bug #​968: Generic.WhiteSpace.ScopeIndent was reporting false positives - and making incorrect fixes - for lines following a line containing an arrow function.
  • Fixed bug #​1216: Tokenizer/PHP: added more defensive coding to prevent PHP 8.5 "Using null as an array offset" deprecation notices.
  • 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.
  • Fixed bug #​1315: Squiz.ControlStructures.SwitchDeclaration: a number of the fixers would get into fixer conflicts with each other if the code under scan contained multiple statements on a line within a switch.
    • The sniff will now forbid - and auto-fix - multiple statements on one line for case/default and "case breaking" statements.
  • Fixed bug #​1316: Tokenizer/PHP: a PHP close tag after a switch case condition or after a default keyword, was not regarded as a "scope_opener" for the case/default body.
  • Fixed bug #​1316: PSR2.ControlStructures.SwitchDeclaration: the WrongOpener error is now also auto-fixable if the wrong opener is a PHP close tag.
  • Fixed bug #​1316: Squiz.PHP.NonExecutableCode would throw false positives when code within a switch control structure would move in and out of PHP.

New Contributors

The PHP_CodeSniffer project is happy to welcome the following new contributors:
@​andrewnicols, @​Soh1121

Statistics

Closed: 2 issues
Merged: 8 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!

v4.0.0: - 2025-09-16

Compare Source

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.
  • Fixed bug #​1172: // phpcs:set for inline array properties did not handle a single item array with the value true, false or null 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 to 3.x and the default branch has changed to the 4.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!

v3.13.6: - 2026-08-06

Compare Source

This is a security release and all users are advised to update their install(s) as soon as possible.

Changed
Fixed
  • SECURITY FIX: Running PHP_CodeSniffer over untrusted files, for example, in a CI pipeline that scans pull requests, or on a developer machine reviewing third-party code, could result in attacker-controlled shell commands being executed when the Gitblame, Hgblame or Svnblame report(s) would process a file whose name contains shell metacharacters. #​1473
Other
  • The GPG signature for the PHAR files has been rotated. The new fingerprint is: 5CB4F77.

Statistics

Closed: 0 issues
Merged: 46 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.5: - 2025-11-04

Compare Source

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
Fixed
  • Fixed bug #​1216: Tokenizer/PHP: added more defensive coding to prevent PHP 8.5 "Using null as an array offset" deprecation notices.
  • 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 master branch has been renamed to 3.x and the default branch has changed to the 4.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.

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

Compare Source

Fixed
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

Compare Source

Added
  • Tokenizer support for PHP 8.4 dereferencing of new expressions without wrapping parentheses. #​1160
  • Tokenizer support for PHP 8.4 abstract properties. #​1183
    • The File::getMemberProperties() method now also supports abstract properties through a new is_abstract array index in the return value. #​1184
    • Additionally, the following sniffs have been updated to support abstract properties:
      • Generic.PHP.LowerCaseConstant #​1185
      • Generic.PHP.UpperCaseConstant #​1185
      • PSR2.Classes.PropertyDeclaration #​1188
      • Squiz.Commenting.VariableComment #​1186
      • Squiz.WhiteSpace.MemberVarSpacing #​1187
    • Thanks to Juliette Reinders Folmer for the patches
  • 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 as T_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
Changed
  • Tokenizer/PHP: fully qualified true/false/null will now be tokenized as T_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.
  • Generic.PHP.Syntax: the sniff is now able to scan input provided via STDIN on non-Windows OSes. #​915
  • PSR2.ControlStructures.SwitchDeclaration: the WrongOpener* error code is now auto-fixable if the identified "wrong opener" is a semi-colon. #​1161
  • 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.
  • Various housekeeping, including improvements to the tests and documentation.
Fixed
  • Fixed bug #​1112 : --parallel option fails if PHP_CodeSniffer is invoked via bash and the invokation creates a non-PHPCS-managed process.
  • 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.
  • Fixed bug #​1154 : PEAR.WhiteSpace.ObjectOperatorIndent: false positive when checking multiple chained method calls in a multidimensional array.
  • Fixed bug #​1193 : edge case inconsistency in how empty string array keys for sniff properties are handled.
  • Fixed bug #​1197 : Squiz.Commenting.FunctionComment: return types containing a class name with underscores would be truncated leading to incorrect results.
Other

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

Compare Source

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.
Fixed
  • Fixed bug #​1135 : Squiz.Functions.FunctionDeclarationArgumentSpacing: typo in new error code SpacingAfterSetVis[i]bility.

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

Compare Source

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
  • Added support for PHP 8.4 (constructor promoted) properties with asymmetric visibility to File::getMethodParameters() through new set_visibility and set_visibility_token array indexes in the return value. #​1116
  • Added support for PHP 8.4 asymmetric visibility modifiers to the following sniffs:
Changed
  • The PSR2.Classes.PropertyDeclaration will now check that a set-visibility modifier keyword is placed after a potential general visibility keyword. #​1119
  • 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.
  • The Squiz.Scope.MemberVarScope will now flag missing "read" visibility, when "write" visibility is set, under a separate error code AsymReadMissing. #​1122
  • 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.
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

Compare Source

Added
  • Added support for PHP 8.4 asymmetric visibility modifiers to the tokenizer. #​871
  • Added support for PHP 8.4 final properties to the following sniffs:
Changed
  • Generic.WhiteSpace.LanguageConstructSpacing: will now also check the spacing after the goto language construct keyword. #​917
  • The PSR2.Classes.PropertyDeclaration will now check that the final modifier keyword is placed before a visibility keyword. #​950
  • Improved Help information about the --reports CLI flag. #​1078
  • 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.
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.
Fixed
  • Fixed bug #​1040 : Generic.Strings.UnnecessaryHeredoc - false positive for heredocs containing escape sequences.
  • Fixed bug #​1040 : Generic.Strings.UnnecessaryHeredoc - fixer would not clean up escape sequences which aren't necessary in nowdocs.
  • Fixed bug #​1048 : A file under scan would sometimes be updated with partial fixes, even though the file "failed to fix".
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

Compare Source

Added
  • Added support for PHP 8.4 final properties to the following sniffs:
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.
  • 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.
Fixed
  • Fixed bug #​830 : PEAR.Commenting.FunctionComment will no longer remove blank lines within attributes.
  • Fixed bug #​929 : Generic.PHP.ForbiddenFunctions: prevent false positives/negatives for code interlaced with comments.
  • Fixed bug #​934 : Generic.PHP.LowerCaseConstant and Generic.PHP.UpperCaseConstant will now correctly ignore DNF types for properties.
  • Fixed bug #​936 : Squiz.Commenting.FunctionCommentThrowTag: sniff would bow out when function has attributes attached, leading to false negatives.
  • Fixed bug #​940 : Squiz.Commenting.VariableComment: false positive for missing docblock for properties using DNF types.
  • Fixed bug #​944 : Squiz.Commenting.FunctionComment did not support DNF/intersection types in @param tags.
  • Fixed bug #​945 : Squiz.WhiteSpace.FunctionSpacing would get confused when there are two docblocks above a function declaration.
  • Fixed bug #​947 : Squiz.Commenting.FunctionCommentThrowTag: prevent false positives/negatives for code interlaced with comments.
  • Fixed bug #​951 : Squiz.Commenting.DocCommentAlignment did not examine docblocks for final classes.
  • Fixed bug #​955 : Potential race condition, leading to a fatal error, when both the Diff + the Code reports are requested and caching is on.
  • Fixed bug #​956 : Generic.WhiteSpace.ScopeIndent: undefined array index notice when running in debug mode.
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

Compare Source

Added
  • Documentation for the following sniffs:
    • Squiz.Commenting.BlockComment
    • Thanks to Colin Stewart for the patch.
Changed
Deprecated
  • The Generic.Functions.CallTimePassByReference sniff. See #​921.
    • This sniff will be removed in version 4.0.0.
Fixed
  • Fixed bug #​906 : Fixer: prevent InvalidArgumentExceptions when displaying verbose information.
  • Fixed bug #​907 : Tokenizer/PHP: tokenization of tokens related to union, intersection and DNF types in combination with PHP 8.4 final properties.
  • Fixed bug #​908 : Tokenizer/PHP: tokenization of ? in nullable types for readonly properties.
  • Fixed bug #​916 : Tokenizer/PHP

Note

PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • 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 becomes conflicted, 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.

@renovate
renovate Bot force-pushed the renovate/packagist-squizlabs-php_codesniffer-vulnerability branch from 8a7e937 to 24eb123 Compare August 15, 2026 11:37
@renovate renovate Bot changed the title Update dependency squizlabs/php_codesniffer to v3 [SECURITY] Update dependency squizlabs/php_codesniffer to v4 [SECURITY] Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

0 participants