Declare_.php 912 B

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