TraitUse.php 889 B

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