ConstFetch.php 676 B

12345678910111213141516171819202122232425262728293031
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node\Expr;
  4. use PhpParser\Node\Name;
  5. class ConstFetch extends Expr
  6. {
  7. /** @var Name Constant name */
  8. public $name;
  9. /**
  10. * Constructs a const fetch node.
  11. *
  12. * @param Name $name Constant name
  13. * @param array $attributes Additional attributes
  14. */
  15. public function __construct(Name $name, array $attributes = []) {
  16. $this->attributes = $attributes;
  17. $this->name = $name;
  18. }
  19. public function getSubNodeNames() : array {
  20. return ['name'];
  21. }
  22. public function getType() : string {
  23. return 'Expr_ConstFetch';
  24. }
  25. }