3 namespace PhpParser\Node;
5 use PhpParser\NodeAbstract;
7 class Param extends NodeAbstract
9 /** @var null|string|Name|NullableType Typehint */
11 /** @var bool Whether parameter is passed by reference */
13 /** @var bool Whether this is a variadic argument */
15 /** @var string Name */
17 /** @var null|Expr Default value */
21 * Constructs a parameter node.
23 * @param string $name Name
24 * @param null|Expr $default Default value
25 * @param null|string|Name|NullableType $type Typehint
26 * @param bool $byRef Whether is passed by reference
27 * @param bool $variadic Whether this is a variadic argument
28 * @param array $attributes Additional attributes
30 public function __construct($name, Expr $default = null, $type = null, $byRef = false, $variadic = false, array $attributes = array()) {
31 parent::__construct($attributes);
33 $this->byRef = $byRef;
34 $this->variadic = $variadic;
36 $this->default = $default;
39 public function getSubNodeNames() {
40 return array('type', 'byRef', 'variadic', 'name', 'default');