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: * @deprecated Use CatchTypeNode, emitted for every catch type, and check isThrown().
14: */
15: #[ReferencedByTurboExtension(key: 'catchWithUnthrownExceptionNode')]
16: final class CatchWithUnthrownExceptionNode extends NodeAbstract implements VirtualNode
17: {
18:
19: public function __construct(private Catch_ $originalNode, private Type $caughtType, private Type $originalCaughtType)
20: {
21: parent::__construct($originalNode->getAttributes());
22: }
23:
24: public function getOriginalNode(): Catch_
25: {
26: return $this->originalNode;
27: }
28:
29: public function getCaughtType(): Type
30: {
31: return $this->caughtType;
32: }
33:
34: public function getOriginalCaughtType(): Type
35: {
36: return $this->originalCaughtType;
37: }
38:
39: #[Override]
40: public function getType(): string
41: {
42: return 'PHPStan_Node_CatchWithUnthrownExceptionNode';
43: }
44:
45: /**
46: * @return string[]
47: */
48: #[Override]
49: public function getSubNodeNames(): array
50: {
51: return [];
52: }
53:
54: }
55: