Match_.php 649 B

12345678910111213141516171819202122232425262728293031
  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. {
  7. /** @var Node\Expr */
  8. public $cond;
  9. /** @var MatchArm[] */
  10. public $arms;
  11. /**
  12. * @param MatchArm[] $arms
  13. */
  14. public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) {
  15. $this->attributes = $attributes;
  16. $this->cond = $cond;
  17. $this->arms = $arms;
  18. }
  19. public function getSubNodeNames() : array {
  20. return ['cond', 'arms'];
  21. }
  22. public function getType() : string {
  23. return 'Expr_Match';
  24. }
  25. }