Ternary.php 928 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * @property PHPParser_Node_Expr $cond Condition
  4. * @property null|PHPParser_Node_Expr $if Expression for true
  5. * @property PHPParser_Node_Expr $else Expression for false
  6. */
  7. class PHPParser_Node_Expr_Ternary extends PHPParser_Node_Expr
  8. {
  9. /**
  10. * Constructs a ternary operator node.
  11. *
  12. * @param PHPParser_Node_Expr $cond Condition
  13. * @param null|PHPParser_Node_Expr $if Expression for true
  14. * @param PHPParser_Node_Expr $else Expression for false
  15. * @param array $attributes Additional attributes
  16. */
  17. public function __construct(PHPParser_Node_Expr $cond, $if, PHPParser_Node_Expr $else, array $attributes = array()) {
  18. parent::__construct(
  19. array(
  20. 'cond' => $cond,
  21. 'if' => $if,
  22. 'else' => $else
  23. ),
  24. $attributes
  25. );
  26. }
  27. }