Closed
Description
Symfony version(s) affected
5.4.25
Description
PHP 8.2
Sf: 5.4.25
Since #[Groups]
and other attributes can be repeated in a target class, I'd suggest adding the flag to avoid false positives in static code analyzers.
https://www.php.net/manual/en/language.attributes.classes.php :
By default an attribute can only be used once per declaration. If the attribute should be repeatable on declarations it must be specified as part of the bitmask to the #[Attribute] declaration.
How to reproduce
Use the Groups or any other repeatable attribute more than once in a class.
The code is simply missing the attribute
Possible Solution
Add a repeatable flag to repeatable attributes.
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)]
class Groups
Additional Context
This showed up when executing phpstan on the max level
Minor thing, but it saves one from ignoring a bunch of valid errors.