MIR1600
InvalidAttribute
An attribute is applied to a target (class, method, property, parameter, etc.) that the attribute does not allow, or the arguments passed to the attribute do not match its constructor signature. PHP validates attribute targets at runtime; mir reports these violations statically.
Example
Section titled “Example”<?php#[\Attribute(\Attribute::TARGET_METHOD)]class MethodOnly {}
#[MethodOnly] // applied to a class, but only METHOD is allowedclass MyClass {}How to fix
Section titled “How to fix”Apply the attribute only to the targets listed in its \Attribute declaration, and ensure the
arguments match the attribute class constructor.