2014-02-06 14:44:16 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace PhpParser\Node\Expr;
|
|
|
|
|
|
|
|
use PhpParser\Node;
|
|
|
|
use PhpParser\Node\Expr;
|
|
|
|
|
|
|
|
class New_ extends Expr
|
|
|
|
{
|
2015-04-26 23:04:31 +02:00
|
|
|
/** @var Node\Name|Expr|Node\Stmt\Class_ Class name */
|
2015-02-28 18:44:28 +01:00
|
|
|
public $class;
|
|
|
|
/** @var Node\Arg[] Arguments */
|
|
|
|
public $args;
|
|
|
|
|
2014-02-06 14:44:16 +01:00
|
|
|
/**
|
|
|
|
* Constructs a function call node.
|
|
|
|
*
|
2015-04-26 23:04:31 +02:00
|
|
|
* @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes)
|
|
|
|
* @param Node\Arg[] $args Arguments
|
|
|
|
* @param array $attributes Additional attributes
|
2014-02-06 14:44:16 +01:00
|
|
|
*/
|
|
|
|
public function __construct($class, array $args = array(), array $attributes = array()) {
|
2015-02-28 18:44:28 +01:00
|
|
|
parent::__construct(null, $attributes);
|
|
|
|
$this->class = $class;
|
|
|
|
$this->args = $args;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSubNodeNames() {
|
|
|
|
return array('class', 'args');
|
2014-02-06 14:44:16 +01:00
|
|
|
}
|
2015-02-28 18:44:28 +01:00
|
|
|
}
|