1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use Override;
6: use PhpParser\Node\Stmt\Catch_;
7: use PhpParser\NodeAbstract;
8: use PHPStan\Turbo\ReferencedByTurboExtension;
9: use PHPStan\Type\Type;
10:
11: /**
12: * @api
13: */
14: #[ReferencedByTurboExtension(key: 'catchWithUnthrownExceptionNode')]
15: final class CatchWithUnthrownExceptionNode extends NodeAbstract implements VirtualNode
16: {
17:
18: public function __construct(private Catch_ $originalNode, private Type $caughtType, private Type $originalCaughtType)
19: {
20: parent::__construct($originalNode->getAttributes());
21: }
22:
23: public function getOriginalNode(): Catch_
24: {
25: return $this->originalNode;
26: }
27:
28: public function getCaughtType(): Type
29: {
30: return $this->caughtType;
31: }
32:
33: public function getOriginalCaughtType(): Type
34: {
35: return $this->originalCaughtType;
36: }
37:
38: #[Override]
39: public function getType(): string
40: {
41: return 'PHPStan_Node_CatchWithUnthrownExceptionNode';
42: }
43:
44: /**
45: * @return string[]
46: */
47: #[Override]
48: public function getSubNodeNames(): array
49: {
50: return [];
51: }
52:
53: }
54: