2011-06-05 18:40:04 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property PHPParser_Node_Expr $cond Condition
|
|
|
|
* @property null|PHPParser_Node_Expr $if Expression for true
|
|
|
|
* @property PHPParser_Node_Expr $else Expression for false
|
|
|
|
*/
|
|
|
|
class PHPParser_Node_Expr_Ternary extends PHPParser_Node_Expr
|
|
|
|
{
|
2011-08-11 10:25:51 +02:00
|
|
|
/**
|
|
|
|
* Constructs a ternary operator node.
|
|
|
|
*
|
|
|
|
* @param PHPParser_Node_Expr $cond Condition
|
|
|
|
* @param null|PHPParser_Node_Expr $if Expression for true
|
|
|
|
* @param PHPParser_Node_Expr $else Expression for false
|
|
|
|
* @param int $line Line
|
|
|
|
* @param null|string $docComment Nearest doc comment
|
|
|
|
*/
|
|
|
|
public function __construct(PHPParser_Node_Expr $cond, $if, PHPParser_Node_Expr $else, $line = -1, $docComment = null) {
|
|
|
|
parent::__construct(
|
|
|
|
array(
|
|
|
|
'cond' => $cond,
|
|
|
|
'if' => $if,
|
|
|
|
'else' => $else
|
|
|
|
),
|
|
|
|
$line, $docComment
|
|
|
|
);
|
|
|
|
}
|
2011-06-05 18:40:04 +02:00
|
|
|
}
|