Error Identifiers: classConstant.*

Menu

← Back to all error identifiers

There are 35 error identifiers in the classConstant.* group:

  • Class constant cannot be named "class" because it is reserved.

  • Accessing a class constant marked as @deprecated.

  • Accessing a class constant on a deprecated class.

  • Accessing a constant or case on a deprecated enum.

  • Accessing a class constant on a deprecated interface.

  • Accessing a class constant on a deprecated trait.

  • Dynamic class constant fetch requires PHP 8.3 or later.

  • Accessing ::class on a string variable is not supported.

  • Overriding a class constant declared as final.

  • Final class constants require PHP 8.1 or later.

  • Private class constant cannot be declared as final.

  • Accessing a class constant marked as @internal from outside its package.

  • Accessing a constant on a class marked as @internal.

  • Accessing a constant on an enum marked as @internal.

  • Accessing a constant on an interface marked as @internal.

  • Accessing a constant defined in a trait marked as @internal.

  • Trait constants require PHP 8.2 or later.

  • Overriding constant is missing the native type declared in the parent.

  • Dynamic class constant name expression is not a string.

  • Dynamic class constant name must be a string type.

  • Overriding constant's native type is not compatible with the parent's type.

  • Native types for class constants require PHP 8.3 or later.

  • Overriding a final trait constant without the final modifier.

  • Accessing a class constant on a non-object, non-class-string value.

  • Accessed class constant does not exist.

  • Accessing ::class on an expression requires PHP 8.0 or later.

  • Accessing a constant directly on a trait is not allowed.

  • PHPDoc @var type on a class constant does not match the assigned value.

  • Accessing a private class constant from outside its class.

  • Accessing a protected class constant from outside its class hierarchy.

  • Overriding constant's type is not covariant with the parent's type.

  • PHPDoc @var type on a class constant contains an unresolvable type.

  • Private class constant is declared but never used.

  • Assigned value does not match the class constant's declared native type.

  • Overriding constant has more restrictive visibility than the parent.