You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
808 B

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