Attribute.php 808 B

12345678910111213141516171819202122232425262728293031323334
  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. }