StaticPropertyFetch.php 1014 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node;
  4. use PhpParser\Node\Expr;
  5. use PhpParser\Node\Name;
  6. use PhpParser\Node\VarLikeIdentifier;
  7. class StaticPropertyFetch extends Expr {
  8. /** @var Name|Expr Class name */
  9. public Node $class;
  10. /** @var VarLikeIdentifier|Expr Property name */
  11. public Node $name;
  12. /**
  13. * Constructs a static property fetch node.
  14. *
  15. * @param Name|Expr $class Class name
  16. * @param string|VarLikeIdentifier|Expr $name Property name
  17. * @param array<string, mixed> $attributes Additional attributes
  18. */
  19. public function __construct(Node $class, $name, array $attributes = []) {
  20. $this->attributes = $attributes;
  21. $this->class = $class;
  22. $this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name;
  23. }
  24. public function getSubNodeNames(): array {
  25. return ['class', 'name'];
  26. }
  27. public function getType(): string {
  28. return 'Expr_StaticPropertyFetch';
  29. }
  30. }