Yield_.php 839 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node\Expr;
  4. class Yield_ extends Expr
  5. {
  6. /** @var null|Expr Key expression */
  7. public $key;
  8. /** @var null|Expr Value expression */
  9. public $value;
  10. /**
  11. * Constructs a yield expression node.
  12. *
  13. * @param null|Expr $value Value expression
  14. * @param null|Expr $key Key expression
  15. * @param array $attributes Additional attributes
  16. */
  17. public function __construct(Expr $value = null, Expr $key = null, array $attributes = []) {
  18. $this->attributes = $attributes;
  19. $this->key = $key;
  20. $this->value = $value;
  21. }
  22. public function getSubNodeNames() : array {
  23. return ['key', 'value'];
  24. }
  25. public function getType() : string {
  26. return 'Expr_Yield';
  27. }
  28. }