Skip to content

MIR1601

UndefinedAttributeClass

An attribute syntax #[ClassName] references a class that cannot be found in the project or its dependencies. This will produce a fatal error when PHP attempts to resolve the attribute at runtime.

<?php
#[NonExistentAttribute] // class NonExistentAttribute not found
class MyClass {}

Ensure the attribute class is defined and autoloaded, or add the correct use import for a namespaced attribute class.