Yield_.php 846 B

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