Attribute.php 820 B

123456789101112131415161718192021222324252627282930313233
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node;
  3. use PhpParser\Node;
  4. use PhpParser\NodeAbstract;
  5. class Attribute extends NodeAbstract {
  6. /** @var Name Attribute name */
  7. public Name $name;
  8. /** @var list<Arg> Attribute arguments */
  9. public array $args;
  10. /**
  11. * @param Node\Name $name Attribute name
  12. * @param list<Arg> $args Attribute arguments
  13. * @param array<string, mixed> $attributes Additional node attributes
  14. */
  15. public function __construct(Name $name, array $args = [], array $attributes = []) {
  16. $this->attributes = $attributes;
  17. $this->name = $name;
  18. $this->args = $args;
  19. }
  20. public function getSubNodeNames(): array {
  21. return ['name', 'args'];
  22. }
  23. public function getType(): string {
  24. return 'Attribute';
  25. }
  26. }