forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClassConstantReflection.php
More file actions
43 lines (31 loc) · 1.15 KB
/
ClassConstantReflection.php
File metadata and controls
43 lines (31 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php declare(strict_types = 1);
namespace PHPStan\Reflection;
use PhpParser\Node\Expr;
use PHPStan\PhpDoc\ResolvedPhpDocBlock;
use PHPStan\Type\Type;
/**
* 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().
*
* @api
* @api-do-not-implement
*/
interface ClassConstantReflection extends ClassMemberReflection, ConstantReflection
{
public function getValueExpr(): Expr;
public function isFinal(): bool;
public function isFinalByKeyword(): bool;
public function hasPhpDocType(): bool;
public function getPhpDocType(): ?Type;
public function hasNativeType(): bool;
public function getNativeType(): ?Type;
public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock;
}