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