StaticCall.php 1.1 KB

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