Renamve Param::$name to Param::$var

As it now contains a Variable node.
This commit is contained in:
Nikita Popov 2017-01-19 23:38:40 +01:00
parent a79306ccd9
commit d7f3c4f9d3
16 changed files with 55 additions and 55 deletions

View File

@ -12,15 +12,15 @@ class Param extends NodeAbstract
public $byRef;
/** @var bool Whether this is a variadic argument */
public $variadic;
/** @var Expr\Variable Name */
public $name;
/** @var Expr\Variable Parameter variable */
public $var;
/** @var null|Expr Default value */
public $default;
/**
* Constructs a parameter node.
*
* @param Expr\Variable $name Name
* @param Expr\Variable $var Parameter variable
* @param null|Expr $default Default value
* @param null|string|Name|NullableType $type Typehint
* @param bool $byRef Whether is passed by reference
@ -28,18 +28,18 @@ class Param extends NodeAbstract
* @param array $attributes Additional attributes
*/
public function __construct(
Expr\Variable $name, Expr $default = null, $type = null,
Expr\Variable $var, Expr $default = null, $type = null,
$byRef = false, $variadic = false, array $attributes = array()
) {
parent::__construct($attributes);
$this->type = $type;
$this->byRef = $byRef;
$this->variadic = $variadic;
$this->name = $name;
$this->var = $var;
$this->default = $default;
}
public function getSubNodeNames() {
return array('type', 'byRef', 'variadic', 'name', 'default');
return array('type', 'byRef', 'variadic', 'var', 'default');
}
}

View File

@ -21,7 +21,7 @@ class Standard extends PrettyPrinterAbstract
return ($node->type ? $this->pType($node->type) . ' ' : '')
. ($node->byRef ? '&' : '')
. ($node->variadic ? '...' : '')
. $this->p($node->name)
. $this->p($node->var)
. ($node->default ? ' = ' . $this->p($node->default) : '');
}

View File

@ -188,7 +188,7 @@ PHP;
"type": null,
"byRef": true,
"variadic": false,
"name": {
"var": {
"nodeType": "Expr_Variable",
"name": "a",
"attributes": {
@ -215,7 +215,7 @@ PHP;
"type": null,
"byRef": false,
"variadic": false,
"name": {
"var": {
"nodeType": "Expr_Variable",
"name": "b",
"attributes": {

View File

@ -60,7 +60,7 @@ CODE;
<subNode:variadic>
<scalar:false/>
</subNode:variadic>
<subNode:name>
<subNode:var>
<node:Expr_Variable>
<attribute:startLine>
<scalar:int>4</scalar:int>
@ -72,7 +72,7 @@ CODE;
<scalar:string>a</scalar:string>
</subNode:name>
</node:Expr_Variable>
</subNode:name>
</subNode:var>
<subNode:default>
<node:Scalar_LNumber>
<attribute:startLine>
@ -106,7 +106,7 @@ CODE;
<subNode:variadic>
<scalar:false/>
</subNode:variadic>
<subNode:name>
<subNode:var>
<node:Expr_Variable>
<attribute:startLine>
<scalar:int>4</scalar:int>
@ -118,7 +118,7 @@ CODE;
<scalar:string>b</scalar:string>
</subNode:name>
</node:Expr_Variable>
</subNode:name>
</subNode:var>
<subNode:default>
<node:Scalar_DNumber>
<attribute:startLine>

View File

@ -20,7 +20,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: param1
)
default: null
@ -29,7 +29,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: param2
)
default: Scalar_LNumber(

View File

@ -19,7 +19,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null
@ -46,7 +46,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null
@ -99,7 +99,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null
@ -134,7 +134,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null

View File

@ -199,7 +199,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: x
)
default: null
@ -265,7 +265,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: x
)
default: Expr_ConstFetch(

View File

@ -178,7 +178,7 @@ array(
)
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: x
)
default: null
@ -336,7 +336,7 @@ array(
)
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: bar
)
default: null

View File

@ -109,7 +109,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null

View File

@ -13,7 +13,7 @@ array(
type: bool
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null
@ -22,7 +22,7 @@ array(
type: int
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: b
)
default: null
@ -31,7 +31,7 @@ array(
type: float
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: c
)
default: null
@ -40,7 +40,7 @@ array(
type: string
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: d
)
default: null
@ -49,7 +49,7 @@ array(
type: iterable
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: e
)
default: null

View File

@ -14,7 +14,7 @@ array(
type: null
byRef: true
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: b
)
default: null
@ -32,7 +32,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: b
)
default: null

View File

@ -23,7 +23,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: b
)
default: Expr_ConstFetch(
@ -38,7 +38,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: c
)
default: Scalar_String(
@ -49,7 +49,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: d
)
default: Expr_ClassConstFetch(
@ -65,7 +65,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: f
)
default: Expr_UnaryPlus(
@ -78,7 +78,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: g
)
default: Expr_UnaryMinus(
@ -91,7 +91,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: h
)
default: Expr_Array(
@ -103,7 +103,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: i
)
default: Expr_Array(
@ -115,7 +115,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: j
)
default: Expr_Array(
@ -134,7 +134,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: k
)
default: Expr_Array(

View File

@ -21,7 +21,7 @@ array(
)
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: bar
)
default: null
@ -32,7 +32,7 @@ array(
)
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: foo
)
default: null

View File

@ -13,7 +13,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: b
)
default: null
@ -22,7 +22,7 @@ array(
type: array
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: c
)
default: null
@ -31,7 +31,7 @@ array(
type: callable
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: d
)
default: null
@ -44,7 +44,7 @@ array(
)
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: f
)
default: null

View File

@ -15,7 +15,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null
@ -24,7 +24,7 @@ array(
type: null
byRef: false
variadic: true
name: Expr_Variable(
var: Expr_Variable(
name: b
)
default: null
@ -42,7 +42,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null
@ -51,7 +51,7 @@ array(
type: null
byRef: true
variadic: true
name: Expr_Variable(
var: Expr_Variable(
name: b
)
default: null
@ -69,7 +69,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null
@ -82,7 +82,7 @@ array(
)
byRef: false
variadic: true
name: Expr_Variable(
var: Expr_Variable(
name: b
)
default: null
@ -100,7 +100,7 @@ array(
type: null
byRef: false
variadic: false
name: Expr_Variable(
var: Expr_Variable(
name: a
)
default: null
@ -113,7 +113,7 @@ array(
)
byRef: true
variadic: true
name: Expr_Variable(
var: Expr_Variable(
name: b
)
default: null

View File

@ -13,7 +13,7 @@ array(
type: null
byRef: false
variadic: true
name: Expr_Variable(
var: Expr_Variable(
name: foo
)
default: Expr_Array(