1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use PhpParser\Node\Expr;
6: use PhpParser\NodeAbstract;
7: use PHPStan\Analyser\Scope;
8:
9: /**
10: * @api
11: * @final
12: */
13: class MatchExpressionNode extends NodeAbstract implements VirtualNode
14: {
15:
16: /**
17: * @param MatchExpressionArm[] $arms
18: */
19: public function __construct(
20: private Expr $condition,
21: private array $arms,
22: Expr\Match_ $originalNode,
23: private Scope $endScope,
24: )
25: {
26: parent::__construct($originalNode->getAttributes());
27: }
28:
29: public function getCondition(): Expr
30: {
31: return $this->condition;
32: }
33:
34: /**
35: * @return MatchExpressionArm[]
36: */
37: public function getArms(): array
38: {
39: return $this->arms;
40: }
41:
42: public function getEndScope(): Scope
43: {
44: return $this->endScope;
45: }
46:
47: public function getType(): string
48: {
49: return 'PHPStan_Node_MatchExpression';
50: }
51:
52: /**
53: * @return string[]
54: */
55: public function getSubNodeNames(): array
56: {
57: return [];
58: }
59:
60: }
61: