1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Reflection;
4:
5: use PhpParser\Node\Expr;
6: use PHPStan\PhpDoc\ResolvedPhpDocBlock;
7: use PHPStan\Type\Type;
8:
9: /**
10: * Reflection for a class constant.
11: *
12: * Combines ClassMemberReflection (declaring class, visibility) with
13: * ConstantReflection (name, value type, deprecation) and adds class-constant-specific
14: * features: the value expression AST, final modifier, and separate PHPDoc/native types.
15: *
16: * PHP 8.3+ supports native type declarations on class constants, so this interface
17: * provides both PHPDoc and native type accessors (similar to property reflection).
18: *
19: * This is the return type of Type::getConstant() and Scope::getConstantReflection().
20: *
21: * @api
22: * @api-do-not-implement
23: */
24: interface ClassConstantReflection extends ClassMemberReflection, ConstantReflection
25: {
26:
27: public function getValueExpr(): Expr;
28:
29: public function isFinal(): bool;
30:
31: public function hasPhpDocType(): bool;
32:
33: public function getPhpDocType(): ?Type;
34:
35: public function hasNativeType(): bool;
36:
37: public function getNativeType(): ?Type;
38:
39: public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock;
40:
41: }
42: