FuncCall.php 1.0 KB

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