Exit_.php 758 B

123456789101112131415161718192021222324252627282930313233
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node\Expr;
  4. class Exit_ extends Expr {
  5. /* For use in "kind" attribute */
  6. public const KIND_EXIT = 1;
  7. public const KIND_DIE = 2;
  8. /** @var null|Expr Expression */
  9. public ?Expr $expr;
  10. /**
  11. * Constructs an exit() node.
  12. *
  13. * @param null|Expr $expr Expression
  14. * @param array<string, mixed> $attributes Additional attributes
  15. */
  16. public function __construct(?Expr $expr = null, array $attributes = []) {
  17. $this->attributes = $attributes;
  18. $this->expr = $expr;
  19. }
  20. public function getSubNodeNames(): array {
  21. return ['expr'];
  22. }
  23. public function getType(): string {
  24. return 'Expr_Exit';
  25. }
  26. }