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\Type\Type; |
9: | |
10: | |
11: | |
12: | |
13: | final class CatchWithUnthrownExceptionNode extends NodeAbstract implements VirtualNode |
14: | { |
15: | |
16: | public function __construct(private Catch_ $originalNode, private Type $caughtType, private Type $originalCaughtType) |
17: | { |
18: | parent::__construct($originalNode->getAttributes()); |
19: | } |
20: | |
21: | public function getOriginalNode(): Catch_ |
22: | { |
23: | return $this->originalNode; |
24: | } |
25: | |
26: | public function getCaughtType(): Type |
27: | { |
28: | return $this->caughtType; |
29: | } |
30: | |
31: | public function getOriginalCaughtType(): Type |
32: | { |
33: | return $this->originalCaughtType; |
34: | } |
35: | |
36: | #[Override] |
37: | public function getType(): string |
38: | { |
39: | return 'PHPStan_Node_CatchWithUnthrownExceptionNode'; |
40: | } |
41: | |
42: | |
43: | |
44: | |
45: | #[Override] |
46: | public function getSubNodeNames(): array |
47: | { |
48: | return []; |
49: | } |
50: | |
51: | } |
52: | |