Skip to content

1.2.0 - 2025-11-11

Choose a tag to compare

@jrfnl jrfnl released this 11 Nov 00:22
· 26 commits to stable since this release
Immutable release. Only release title and notes can be modified.
fa82d14

Added

Utils

  • New PHPCSUtils\Utils\AttributeBlock class: Utility functions to examine attribute blocks. #720, #729
    For the purposes of these utilities, an "attribute block" is defined as being an attribute opener, an attribute closer and everything between. I.e. #[MyAttribute(1, 2), AnotherAttribute] is one attribute block.
    Initial set of available methods:
    • getAttributes() to retrieve information about each attribute being instantiated within a particular attribute block.
    • countAttributes() to retrieve a count of the number of attribute instantiations with a particular attribute block.
    • appliesTo() to find the stack pointer to the language construct an attribute block applies to.
  • New PHPCSUtils\Utils\Constants::getAttributeOpeners(), PHPCSUtils\Utils\FunctionDeclarations::getAttributeOpeners(), PHPCSUtils\Utils\ObjectDeclarations::getAttributeOpeners() and PHPCSUtils\Utils\Variables::getAttributeOpeners() utility methods. #719
    These methods will each return an array with the stack pointers to the attribute openers for applicable attribute blocks.
    This may be an empty array if no attributes apply to the constant/function/OO structure/property.

Changed

Other

  • Dropped support for PHP_CodeSniffer < 3.13.5/4.0.1. #729
    Please ensure you run composer update phpcsstandards/phpcsutils --with-dependencies to benefit from this.
  • Various housekeeping.