No Description

StaticCall.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. {
  10. /** @var Node\Name|Expr Class name */
  11. public $class;
  12. /** @var Identifier|Expr Method name */
  13. public $name;
  14. /** @var array<Arg|VariadicPlaceholder> Arguments */
  15. public $args;
  16. /**
  17. * Constructs a static method call node.
  18. *
  19. * @param Node\Name|Expr $class Class name
  20. * @param string|Identifier|Expr $name Method name
  21. * @param array<Arg|VariadicPlaceholder> $args Arguments
  22. * @param array $attributes Additional attributes
  23. */
  24. public function __construct($class, $name, array $args = [], array $attributes = []) {
  25. $this->attributes = $attributes;
  26. $this->class = $class;
  27. $this->name = \is_string($name) ? new Identifier($name) : $name;
  28. $this->args = $args;
  29. }
  30. public function getSubNodeNames() : array {
  31. return ['class', 'name', 'args'];
  32. }
  33. public function getType() : string {
  34. return 'Expr_StaticCall';
  35. }
  36. public function getRawArgs(): array {
  37. return $this->args;
  38. }
  39. }