website/errors/attribute.deprecatedEnum.md
<?php declare(strict_types = 1); // lint >= 8.1
/** @deprecated Use NewStatus instead */
enum OldStatus
{
case Active;
case Inactive;
}
#[OldStatus]
class Foo
{
}
This error is reported by the phpstan-deprecation-rules extension.
An attribute references an enum that has been marked as @deprecated. Deprecated enums are planned for removal in a future version, and attributes should not rely on them.
Note: triggering this identifier requires using an enum as an attribute, which PHP does not support. PHPStan therefore always also reports an attribute.notAttribute error, and in practice the deprecation identifier is not reported alongside it.
Replace the usage of the deprecated enum with a proper attribute class:
-#[OldStatus]
+#[NewStatusAttribute]
class Foo
{
}