Skip to content

3.12.2 - 2025-04-13

Latest
Compare
Choose a tag to compare
@jrfnl jrfnl released this 13 Apr 04:49
· 62 commits to master since this release
3.12.2
6d4cf60

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.
  • 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!