StaticCall.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node;
  4. use PhpParser\Node\Arg;
  5. use PhpParser\Node\Expr;
  6. use PhpParser\Node\Identifier;
  7. use PhpParser\Node\VariadicPlaceholder;
  8. class StaticCall extends CallLike {
  9. /** @var Node\Name|Expr Class name */
  10. public Node $class;
  11. /** @var Identifier|Expr Method name */
  12. public Node $name;
  13. /** @var array<Arg|VariadicPlaceholder> Arguments */
  14. public array $args;
  15. /**
  16. * Constructs a static method call node.
  17. *
  18. * @param Node\Name|Expr $class Class name
  19. * @param string|Identifier|Expr $name Method name
  20. * @param array<Arg|VariadicPlaceholder> $args Arguments
  21. * @param array<string, mixed> $attributes Additional attributes
  22. */
  23. public function __construct(Node $class, $name, array $args = [], array $attributes = []) {
  24. $this->attributes = $attributes;
  25. $this->class = $class;
  26. $this->name = \is_string($name) ? new Identifier($name) : $name;
  27. $this->args = $args;
  28. }
  29. public function getSubNodeNames(): array {
  30. return ['class', 'name', 'args'];
  31. }
  32. public function getType(): string {
  33. return 'Expr_StaticCall';
  34. }
  35. public function getRawArgs(): array {
  36. return $this->args;
  37. }
  38. }