Match_.php 782 B

1234567891011121314151617181920212223242526272829303132
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node;
  4. use PhpParser\Node\MatchArm;
  5. class Match_ extends Node\Expr {
  6. /** @var Node\Expr Condition */
  7. public Node\Expr $cond;
  8. /** @var MatchArm[] */
  9. public array $arms;
  10. /**
  11. * @param Node\Expr $cond Condition
  12. * @param MatchArm[] $arms
  13. * @param array<string, mixed> $attributes Additional attributes
  14. */
  15. public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) {
  16. $this->attributes = $attributes;
  17. $this->cond = $cond;
  18. $this->arms = $arms;
  19. }
  20. public function getSubNodeNames(): array {
  21. return ['cond', 'arms'];
  22. }
  23. public function getType(): string {
  24. return 'Expr_Match';
  25. }
  26. }