No Description

New_.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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\VariadicPlaceholder;
  7. class New_ extends CallLike
  8. {
  9. /** @var Node\Name|Expr|Node\Stmt\Class_ Class name */
  10. public $class;
  11. /** @var array<Arg|VariadicPlaceholder> Arguments */
  12. public $args;
  13. /**
  14. * Constructs a function call node.
  15. *
  16. * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes)
  17. * @param array<Arg|VariadicPlaceholder> $args Arguments
  18. * @param array $attributes Additional attributes
  19. */
  20. public function __construct($class, array $args = [], array $attributes = []) {
  21. $this->attributes = $attributes;
  22. $this->class = $class;
  23. $this->args = $args;
  24. }
  25. public function getSubNodeNames() : array {
  26. return ['class', 'args'];
  27. }
  28. public function getType() : string {
  29. return 'Expr_New';
  30. }
  31. public function getRawArgs(): array {
  32. return $this->args;
  33. }
  34. }