Interface PHPStan\Reflection\ClassConstantReflection

extends ClassMemberReflection, ConstantReflection

Reflection for a class constant. Combines ClassMemberReflection (declaring class, visibility) with ConstantReflection (name, value type, deprecation) and adds class-constant-specific features: the value expression AST, final modifier, and separate PHPDoc/native types. PHP 8.3+ supports native type declarations on class constants, so this interface provides both PHPDoc and native type accessors (similar to property reflection). This is the return type of Type::getConstant() and Scope::getConstantReflection().

  • PHPStan\Reflection\ClassConstantReflection extends ClassMemberReflection, ConstantReflection
    • PHPStan\Rules\RestrictedUsage\RewrittenDeclaringClassClassConstantReflection implements ClassConstantReflection
    • PHPStan\Reflection\Dummy\DummyClassConstantReflection implements ClassConstantReflection
    • PHPStan\Reflection\RealClassClassConstantReflection implements ClassConstantReflection
Methods
Methods inherited from PHPStan\Reflection\ClassMemberReflection
getDeclaringClass(), isStatic(), isPrivate(), isPublic(), getDocComment()
Methods inherited from PHPStan\Reflection\ConstantReflection
getName(), getValueType(), isDeprecated(), getDeprecatedDescription(), isInternal(), getFileName(), getAttributes()