No Description

Ternary.php 831B

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