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\Turbo\ReferencedByTurboExtension;
9:
10: /**
11: * @api
12: */
13: #[ReferencedByTurboExtension(key: 'instantiationCallableNode')]
14: final class InstantiationCallableNode extends Expr implements VirtualNode
15: {
16:
17: public function __construct(private Name|Expr $class, private Expr\New_ $originalNode)
18: {
19: parent::__construct($this->originalNode->getAttributes());
20: }
21:
22: /**
23: * @return Expr|Name
24: */
25: public function getClass()
26: {
27: return $this->class;
28: }
29:
30: public function getOriginalNode(): Expr\New_
31: {
32: return $this->originalNode;
33: }
34:
35: #[Override]
36: public function getType(): string
37: {
38: return 'PHPStan_Node_InstantiationCallableNode';
39: }
40:
41: /**
42: * @return string[]
43: */
44: #[Override]
45: public function getSubNodeNames(): array
46: {
47: return [];
48: }
49:
50: }
51: