mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-01-17 23:28:15 +01:00
502b090900
Types omitted in two places where we violate them currently: Namespace_::$stmts can be null during parsing, and Enum_::$scalarType can be a complex type for invalid programs.
31 lines
663 B
PHP
31 lines
663 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace PhpParser\Node\Expr;
|
|
|
|
use PhpParser\Node;
|
|
use PhpParser\Node\MatchArm;
|
|
|
|
class Match_ extends Node\Expr {
|
|
/** @var Node\Expr */
|
|
public Node\Expr $cond;
|
|
/** @var MatchArm[] */
|
|
public array $arms;
|
|
|
|
/**
|
|
* @param MatchArm[] $arms
|
|
*/
|
|
public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) {
|
|
$this->attributes = $attributes;
|
|
$this->cond = $cond;
|
|
$this->arms = $arms;
|
|
}
|
|
|
|
public function getSubNodeNames(): array {
|
|
return ['cond', 'arms'];
|
|
}
|
|
|
|
public function getType(): string {
|
|
return 'Expr_Match';
|
|
}
|
|
}
|