MethodCall.php 906 B

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