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 $className;
14:
15: /** @var string */
16: public $name;
17:
18: public function __construct(string $className, string $name)
19: {
20: $this->className = $className;
21: $this->name = $name;
22: }
23:
24:
25: public function __toString(): string
26: {
27: if ($this->className === '') {
28: return $this->name;
29:
30: }
31:
32: return "{$this->className}::{$this->name}";
33: }
34:
35: }
36: