Const_.php 967 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node;
  4. class Const_ extends Node\Stmt {
  5. /** @var Node\Const_[] Constant declarations */
  6. public array $consts;
  7. /** @var Node\AttributeGroup[] PHP attribute groups */
  8. public array $attrGroups;
  9. /**
  10. * Constructs a const list node.
  11. *
  12. * @param Node\Const_[] $consts Constant declarations
  13. * @param array<string, mixed> $attributes Additional attributes
  14. * @param list<Node\AttributeGroup> $attrGroups PHP attribute groups
  15. */
  16. public function __construct(
  17. array $consts,
  18. array $attributes = [],
  19. array $attrGroups = []
  20. ) {
  21. $this->attributes = $attributes;
  22. $this->attrGroups = $attrGroups;
  23. $this->consts = $consts;
  24. }
  25. public function getSubNodeNames(): array {
  26. return ['attrGroups', 'consts'];
  27. }
  28. public function getType(): string {
  29. return 'Stmt_Const';
  30. }
  31. }