57301390fec180a609ec0280eefc3ed4538f923c
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Node / Expr / Ternary.php
1 <?php
2
3 namespace PhpParser\Node\Expr;
4
5 use PhpParser\Node\Expr;
6
7 class Ternary extends Expr
8 {
9     /** @var Expr Condition */
10     public $cond;
11     /** @var null|Expr Expression for true */
12     public $if;
13     /** @var Expr Expression for false */
14     public $else;
15
16     /**
17      * Constructs a ternary operator node.
18      *
19      * @param Expr      $cond       Condition
20      * @param null|Expr $if         Expression for true
21      * @param Expr      $else       Expression for false
22      * @param array                    $attributes Additional attributes
23      */
24     public function __construct(Expr $cond, $if, Expr $else, array $attributes = array()) {
25         parent::__construct($attributes);
26         $this->cond = $cond;
27         $this->if = $if;
28         $this->else = $else;
29     }
30
31     public function getSubNodeNames() {
32         return array('cond', 'if', 'else');
33     }
34 }