← Back to all error identifiers
Error Identifiers: enum.*
There are 30 error identifiers in the enum.* group:
-
enum.allowDynamicProperties non-ignorableAllowDynamicProperties attribute cannot be used on enums.
-
enum.backingType non-ignorableEnum backing type is not int or string.
-
enum.caseMissingOverride auto-fixableEnum case overrides an interface constant but is missing the #[Override] attribute.
-
enum.caseNativeType non-ignorableEnum case overrides an interface constant that has a native type.
-
enum.caseOutsideOfEnum non-ignorableUsing an enum case declaration inside a class, interface, or trait instead of an enum.
-
Enum case has the #[Override] attribute but does not override any constant.
-
enum.caseOverrideAttribute non-ignorableThe #[Override] attribute is used on an enum case on a PHP version older than 8.6.
-
enum.caseOverridesFinal non-ignorableEnum case overrides a final constant declared in an implemented interface.
-
enum.caseType non-ignorableEnum case value does not match the declared backing type, or the case is incompatible with the type of the overridden interface constant.
-
enum.caseWithValue non-ignorablePure enum case has a value, but only backed enums can have case values.
-
Enum declares a constructor, which is not allowed.
-
enum.debugInfoNotSupported non-ignorableEnum declares the __debugInfo() magic method, which is supported only on PHP 8.6 and later.
-
enum.deprecatedAttribute non-ignorableNative #[Deprecated] attribute cannot be used on enums.
-
enum.destructor non-ignorableEnum declares a destructor, which is not allowed.
-
Enum is not listed as an allowed subtype of the sealed interface.
-
Enum with the same name is declared multiple times.
-
enum.duplicateConstant non-ignorableEnum declares two constants with the same name.
-
enum.duplicateEnumCase non-ignorableEnum declares two cases with the same name.
-
enum.duplicateMethod non-ignorableEnum declares two methods with the same name.
-
enum.duplicateProperty non-ignorableProperty is declared more than once in an enum.
-
enum.duplicateValue non-ignorableMultiple enum cases share the same backing value.
-
Enum uses a @template type parameter, but enums cannot be generic.
-
enum.implementsDeprecatedInterface phpstan-deprecation-rulesEnum implements an interface marked as deprecated.
-
Enum implements an internal interface from another package.
-
enum.magicMethod non-ignorableEnum declares a disallowed magic method.
-
enum.methodRedeclaration non-ignorableEnum redeclares a built-in method that cannot be overridden.
-
enum.missingCase non-ignorableBacked enum case is missing a required value.
-
Enum name is referenced with incorrect letter casing.
-
enum.nameInUse non-ignorableEnum name conflicts with an existing name in the same namespace.
-
enum.serializable non-ignorableEnum cannot implement the Serializable interface.