Skip to content

Releases: PHPCSStandards/PHPCSExtra

1.5.0 - 2025-11-13

12 Nov 23:15
Immutable release. Only release title and notes can be modified.
b598aa8

Choose a tag to compare

Added

Universal

  • 🔧 📊 📚 New Universal.Attributes.BracketSpacing sniff to enforce a fixed number of spaces on the inside of attribute block brackets. #386, #406
    The sniff offers the following properties to influence its behaviour:
    • spacing (defaults to 0).
    • ignoreNewlines (defaults to false).
      When new lines are allowed (ignoreNewlines=true) and a new line is found, the sniff will verify that there are no superfluous blank lines at the start/end of an attribute block.
  • 🔧 📊 📚 New Universal.Attributes.DisallowAttributeParentheses sniff to forbid parentheses for attribute instantiations without arguments. #387, #409
  • 🔧 📊 📚 New Universal.Attributes.RequireAttributeParentheses sniff to demand that all attribute instantiations always use parentheses, even if no argument is passed. #387, #410
  • 🔧 📊 📚 New Universal.Attributes.TrailingComma sniff to demand a trailing comma for multi-line, multi-attribute attribute blocks and forbid trailing commas in single-line attribute blocks and in multi-line attributes containing only a single attribute. #397, #413
  • 🔧 📊 📚 New Universal.PHP.DisallowExitDieParentheses sniff to forbid invocations of exit/die with parentheses when no argument is passed. #399
  • 🔧 📊 📚 New Universal.PHP.RequireExitDieParentheses sniff to demand that invocations of exit/die always use parentheses, even if no argument is passed. #398
  • 🔧 📚 New Universal.WhiteSpace.FirstClassCallableSpacing sniff to enforce consistent spacing around the ellipses for first class callables. #385
    The sniff offers the following property to influence its behaviour: spacing (defaults to 0).

Changed

Universal

  • Universal.WhiteSpace.CommaSpacing: improved handling of commas in PHP attributes. #391, #412
    • The spacing after a trailing comma (after the last attribute in a block) will no longer be checked to prevent potential conflicts with attribute bracket spacing sniffs.
    • Spacing errors for commas between attributes in an attribute block will now get an *InAttributeBlock error code suffix, so in-/excluding them selectively is more straight-forward.
      Note: spacing around commas between parameters passed to an attribute will still be reported with the *InFunctionCall error code suffix, same as before.
    • Metrics for comma spacing in attribute blocks is now also measured and reported separately.

Other

  • Composer: The minimum PHP_CodeSniffer requirement has been updated to ^3.13.5 || ^4.0.1 (was ^3.13.4 || ^4.0.0). #408
  • Composer: The minimum PHPCSUtils requirement has been updated to ^1.2.0 (was ^1.1.2). #408
  • Various housekeeping.

1.4.2 - 2025-10-28

28 Oct 17:11
Immutable release. Only release title and notes can be modified.
8e89a01

Choose a tag to compare

Changed

Other

  • Various housekeeping.

Fixed

Universal

  • Universal.OOStructures.AlphabeticExtendsImplements incorrectly displayed the "expected" and "found" names. #378
  • Universal.WhiteSpace.CommaSpacing could accidentally cause a fatal error if the content adjacent to the comma was a text string containing percentage signs. Thanks @westonruter for reporting! #400, #401

1.4.1 - 2025-09-05

05 Sep 06:59
882b8c9

Choose a tag to compare

Changed

Other

  • Various housekeeping.

Fixed

Universal

  • Universal.PHP.NoFQNTrueFalseNull: fix breakage due to upstream change in tokenization. #375

1.4.0 - 2025-06-14

14 Jun 07:47
fa4b8d0

Choose a tag to compare

Added

  • All sniffs: compatibility with the new PHP_CodeSniffer 4.x branch in anticipation of the PHP_CodeSniffer 4.0 release. #367
    PHPCSExtra should now be fully compatible with PHP_CodeSniffer 4.0. If you still find an issue, please report it.

Changed

Other

  • Composer: The minimum PHP_CodeSniffer requirement has been updated to ^3.13.0 (was ^3.12.1). #361
  • Composer: The minimum PHPCSUtils requirement has been updated to ^1.1.0 (was ^1.0.12). #361
  • Various housekeeping.

Deprecated

Universal

  • Universal.WhiteSpace.PrecisionAlignment: support for scanning JS/CSS files via this sniff is now deprecated. #367

Fixed

Universal

  • Universal.Arrays.DuplicateArrayKey: false positives for numeric strings with leading/trailing underscores. Fixed via the update to PHPCSUtils 1.1.0. #363
  • Universal.Arrays.DuplicateArrayKey: false negatives for fully qualified true/false/null arrays keys. Fixed via the update to PHPCSUtils 1.1.0. #363
  • Universal.WhiteSpace.CommaSpacing: wrong errorcode for comma's in closure use statements after the update to PHPCSUtils 1.1.0. #362

1.3.1 - 2025-06-08

08 Jun 20:05
8cb1a93

Choose a tag to compare

Changed

Other

  • Composer: The minimum PHPCSUtils requirement has been updated to ^1.0.12 (was ^1.0.9). #346
  • Various housekeeping.

Fixed

Universal

  • Universal.UseStatements.DisallowMixedGroupUse: the fixer could get confused when the "base" name for the group name contained a leading backslash, leading to parse errors in the fixed code. #350

1.3.0 - 2025-04-21

20 Apr 23:42
46d08eb

Choose a tag to compare

Added

Universal

  • 🔧 📚 New Universal.PHP.NoFQNTrueFalseNull sniff to forbid using true, false and null as fully qualified constants. Thanks @rodrigoprimo for reviewing. #327
  • Universal.Operators.TypeSeparatorSpacing: support for checking the spacing around the parentheses used in PHP 8.2+ DNF types. #329

Changed

Universal

  • The Universal.WhiteSpace.DisallowInlineTabs sniff will now also check for inline tabs in heredoc/nowdoc openers and between the yield and from keywords. #320

Other

  • Composer: The minimum PHP_CodeSniffer requirement has been updated to ^3.12.1 (was ^3.8.0). #330
  • Developer happiness: prevent creating a composer.lock file. Thanks @fredden! #307
  • Various housekeeping, including improvements to the documentation and tests.

1.2.1 - 2023-12-08

08 Dec 16:51
11d387c

Choose a tag to compare

Changed

Other

  • Composer: The minimum PHP_CodeSniffer requirement has been updated to ^3.8.0 (was ^3.7.2). #298
  • Composer: The minimum PHPCSUtils requirement has been updated to ^1.0.9 (was ^1.0.8). #298

Please ensure you run composer update phpcsstandards/phpcsextra --with-dependencies to benefit from this.

1.2.0 - 2023-12-02

02 Dec 14:32
78b2cae

Choose a tag to compare

Added

Universal

  • 🔧 📚 New Universal.CodeAnalysis.NoDoubleNegative sniff to detect double negatives (!!) and advise to use a boolean cast instead. Thanks @diedexx for reviewing. #277
  • 🔧 📚 New Universal.Operators.ConcatPosition sniff to enforce that the concatenation operator for multi-line concatenations is in a preferred position, either always at the start of the next line or always at the end of the previous line. #294
  • 🔧 📊 📚 New Universal.PHP.LowercasePHPTag sniff to enforce that the "PHP" in a PHP open tag is lowercase. Thanks @fredden for reviewing. #276

Changed

NormalizedArrays

  • NormalizedArrays.Arrays.CommaAfterLast: the sniff now has two extra error codes to distinguish between multi-line arrays with the last array item on the same line as the array closer vs the last array item being on a line before the array closer. Thanks @stronk7 for suggesting and patching this. #283, #284
    These new error codes allow for selectively excluding that specific situation from triggering the sniff.
    The new error codes are FoundMultiLineCloserSameLine (for multiLine="forbid") and MissingMultiLineCloserSameLine (for multiLine="enforce").
    The pre-existing FoundMultiLine and FoundSingleLine error codes continue to be used for multi-line arrays with the last array item on a different line than the array closer.

Other

  • Various housekeeping.

1.1.2 - 2023-09-21

20 Sep 22:10
746c319

Choose a tag to compare

Changed

Other

  • Various housekeeping.

Fixed

Universal

  • Universal.CodeAnalysis.ConstructorDestructorReturn: the sniff will now correctly ignore methods mirroring the class name (PHP-4 style constructors) in namespaced code. #207, #272

1.1.1 - 2023-08-26

26 Aug 04:50
98bcdba

Choose a tag to compare

Changed

Modernize

  • Modernize.FunctionCalls.Dirname: the sniff will now respect a potentially set php_version configuration option and only report on modernizations which are possible on the configured php_version. #261
    If the php_version is not set, the sniff will continue to report on all modernization options.

Other

  • Various documentation improvements. Props in part to @szepeviktor.
  • Improved defensive coding in select places.
  • Various housekeeping.