Attributes
- '#[ArrayShape]' attribute can be added
Reports the methods and functions that are returning arrays with known non-trivial keys.
- '#[Pure]' attribute can be added
Reports the functions that are non-trivially pure.
- Array key does not match array shape
Reports the array keys that do not match the keys specified via the #[ArrayShape] attribute.
- Attribute can be added to overriding member
Reports the methods' and parameters' attributes that can be propagated to overriding methods/parameters.
- Class cannot be used as attribute
Reports the attributes that are resolved to a class not annotated with #[Attribute].
- Comment is parsed as attribute in PHP 8.0
Reports line comments starting with #[.
- Expected values should be used
Reports the values in assignment and comparison expressions that should be replaced with one of the expected values (that is, the values specified via the #[ExpectedValues] attribute).
- Immutable property written in invalid scope
Highlights write access references to properties, for which the write access scope declared via #[Immutable] is stricter than the reference scope.
- Mark overridden method with #[Override]
Suggests adding the #[Override] attribute to the methods that override same name methods in the parent class or any of the implemented interfaces.
- Method does not override the method from its superclass
Checks that the overridden method exists.
- NoReturn attribute can be added
Reports function without #[NoReturn] that are always halting their execution by calling other exitPoint functions attribute.
- Non-applicable attribute target declaration
Reports the attributes that do not have the appropriate Attribute::TARGET_* flag in their arguments declaration.
- Non-repeatable attribute
Reports repeated attributes without the Attribute::IS_REPEATABLE flag in their arguments declaration.
- Pure function may produce side effects
Reports the #[Pure] annotations used on functions that may produce side effects.
- Redundant parentheses in attribute
Reports empty arguments lists in attributes.