GroupUse.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node\Name;
  4. use PhpParser\Node\Stmt;
  5. use PhpParser\Node\UseItem;
  6. class GroupUse extends Stmt {
  7. /**
  8. * @var Use_::TYPE_* Type of group use
  9. */
  10. public int $type;
  11. /** @var Name Prefix for uses */
  12. public Name $prefix;
  13. /** @var UseItem[] Uses */
  14. public array $uses;
  15. /**
  16. * Constructs a group use node.
  17. *
  18. * @param Name $prefix Prefix for uses
  19. * @param UseItem[] $uses Uses
  20. * @param Use_::TYPE_* $type Type of group use
  21. * @param array<string, mixed> $attributes Additional attributes
  22. */
  23. public function __construct(Name $prefix, array $uses, int $type = Use_::TYPE_NORMAL, array $attributes = []) {
  24. $this->attributes = $attributes;
  25. $this->type = $type;
  26. $this->prefix = $prefix;
  27. $this->uses = $uses;
  28. }
  29. public function getSubNodeNames(): array {
  30. return ['type', 'prefix', 'uses'];
  31. }
  32. public function getType(): string {
  33. return 'Stmt_GroupUse';
  34. }
  35. }