1.2.0 - 2025-11-11
·
26 commits
to stable
since this release
Immutable
release. Only release title and notes can be modified.
Added
Utils
- New
PHPCSUtils\Utils\AttributeBlockclass: 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()andPHPCSUtils\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 runcomposer update phpcsstandards/phpcsutils --with-dependenciesto benefit from this. - Various housekeeping.