1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\PhpDocParser\Ast\ConstExpr;
4:
5: use PHPStan\PhpDocParser\Ast\NodeAttributes;
6:
7: class ConstFetchNode implements ConstExprNode
8: {
9:
10: use NodeAttributes;
11:
12: /** @var string class name for class constants or empty string for non-class constants */
13: public string $className;
14:
15: public string $name;
16:
17: public function __construct(string $className, string $name)
18: {
19: $this->className = $className;
20: $this->name = $name;
21: }
22:
23: public function __toString(): string
24: {
25: if ($this->className === '') {
26: return $this->name;
27:
28: }
29:
30: return "{$this->className}::{$this->name}";
31: }
32:
33: }
34: