Do_.php 819 B

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