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