1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use PhpParser\Node\Stmt\Catch_;
6: use PhpParser\NodeAbstract;
7: use PHPStan\Type\Type;
8:
9: /**
10: * @api
11: * @final
12: */
13: 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: public function getType(): string
37: {
38: return 'PHPStan_Node_CatchWithUnthrownExceptionNode';
39: }
40:
41: /**
42: * @return string[]
43: */
44: public function getSubNodeNames(): array
45: {
46: return [];
47: }
48:
49: }
50: