| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | namespace PhpParser\Node\Expr; |
| 4: | |
| 5: | use PhpParser\Node\Expr; |
| 6: | |
| 7: | class Ternary extends Expr { |
| 8: | |
| 9: | public Expr $cond; |
| 10: | |
| 11: | public ?Expr $if; |
| 12: | |
| 13: | public Expr $else; |
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | public function __construct(Expr $cond, ?Expr $if, Expr $else, array $attributes = []) { |
| 24: | $this->attributes = $attributes; |
| 25: | $this->cond = $cond; |
| 26: | $this->if = $if; |
| 27: | $this->else = $else; |
| 28: | } |
| 29: | |
| 30: | public function getSubNodeNames(): array { |
| 31: | return ['cond', 'if', 'else']; |
| 32: | } |
| 33: | |
| 34: | public function getType(): string { |
| 35: | return 'Expr_Ternary'; |
| 36: | } |
| 37: | } |
| 38: | |