New_.php 949 B

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