1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use Override;
6: use PhpParser\Node\Expr;
7: use PhpParser\Node\Identifier;
8: use PhpParser\Node\Name;
9: use PHPStan\Node\Printer\ExprPrinter;
10: use PHPStan\Turbo\ReferencedByTurboExtension;
11:
12: /**
13: * @api
14: */
15: #[ReferencedByTurboExtension(key: 'staticMethodCallableNode')]
16: final class StaticMethodCallableNode extends Expr implements VirtualNode
17: {
18:
19: public function __construct(
20: private Name|Expr $class,
21: private Identifier|Expr $name,
22: private Expr\StaticCall $originalNode,
23: )
24: {
25: // the original's printed expression key must not become this node's
26: $attributes = $originalNode->getAttributes();
27: unset($attributes[ExprPrinter::ATTRIBUTE_CACHE_KEY]);
28: parent::__construct($attributes);
29: }
30:
31: /**
32: * @return Expr|Name
33: */
34: public function getClass()
35: {
36: return $this->class;
37: }
38:
39: /**
40: * @return Identifier|Expr
41: */
42: public function getName()
43: {
44: return $this->name;
45: }
46:
47: public function getOriginalNode(): Expr\StaticCall
48: {
49: return $this->originalNode;
50: }
51:
52: #[Override]
53: public function getType(): string
54: {
55: return 'PHPStan_Node_StaticMethodCallableNode';
56: }
57:
58: /**
59: * @return string[]
60: */
61: #[Override]
62: public function getSubNodeNames(): array
63: {
64: return [];
65: }
66:
67: }
68: