xref: /PHP-Parser/lib/PhpParser/Node/MatchArm.php (revision 502b0909)
1<?php declare(strict_types=1);
2
3namespace PhpParser\Node;
4
5use PhpParser\Node;
6use PhpParser\NodeAbstract;
7
8class MatchArm extends NodeAbstract {
9    /** @var null|list<Node\Expr> */
10    public ?array $conds;
11    /** @var Node\Expr */
12    public Expr $body;
13
14    /**
15     * @param null|list<Node\Expr> $conds
16     */
17    public function __construct(?array $conds, Node\Expr $body, array $attributes = []) {
18        $this->conds = $conds;
19        $this->body = $body;
20        $this->attributes = $attributes;
21    }
22
23    public function getSubNodeNames(): array {
24        return ['conds', 'body'];
25    }
26
27    public function getType(): string {
28        return 'MatchArm';
29    }
30}
31