mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-11-26 20:04:48 +01:00
Rename StaticVar::$name to $var
As it now holds a Variable
This commit is contained in:
parent
6238f5f9f9
commit
a79306ccd9
@ -7,27 +7,27 @@ use PhpParser\Node\Expr;
|
||||
|
||||
class StaticVar extends Node\Stmt
|
||||
{
|
||||
/** @var Expr\Variable Name */
|
||||
public $name;
|
||||
/** @var Expr\Variable Variable */
|
||||
public $var;
|
||||
/** @var null|Node\Expr Default value */
|
||||
public $default;
|
||||
|
||||
/**
|
||||
* Constructs a static variable node.
|
||||
*
|
||||
* @param Expr\Variable $name Name
|
||||
* @param Expr\Variable $var Name
|
||||
* @param null|Node\Expr $default Default value
|
||||
* @param array $attributes Additional attributes
|
||||
*/
|
||||
public function __construct(
|
||||
Expr\Variable $name, Node\Expr $default = null, array $attributes = array()
|
||||
Expr\Variable $var, Node\Expr $default = null, array $attributes = array()
|
||||
) {
|
||||
parent::__construct($attributes);
|
||||
$this->name = $name;
|
||||
$this->var = $var;
|
||||
$this->default = $default;
|
||||
}
|
||||
|
||||
public function getSubNodeNames() {
|
||||
return array('name', 'default');
|
||||
return array('var', 'default');
|
||||
}
|
||||
}
|
||||
|
@ -814,7 +814,7 @@ class Standard extends PrettyPrinterAbstract
|
||||
}
|
||||
|
||||
protected function pStmt_StaticVar(Stmt\StaticVar $node) {
|
||||
return $this->p($node->name)
|
||||
return $this->p($node->var)
|
||||
. (null !== $node->default ? ' = ' . $this->p($node->default) : '');
|
||||
}
|
||||
|
||||
|
@ -42,13 +42,13 @@ array(
|
||||
0: Stmt_Static(
|
||||
vars: array(
|
||||
0: Stmt_StaticVar(
|
||||
name: Expr_Variable(
|
||||
var: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Stmt_StaticVar(
|
||||
name: Expr_Variable(
|
||||
var: Expr_Variable(
|
||||
name: bar
|
||||
)
|
||||
default: Scalar_LNumber(
|
||||
|
@ -35,13 +35,13 @@ array(
|
||||
1: Stmt_Static(
|
||||
vars: array(
|
||||
0: Stmt_StaticVar(
|
||||
name: Expr_Variable(
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Stmt_StaticVar(
|
||||
name: Expr_Variable(
|
||||
var: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
default: Scalar_String(
|
||||
|
Loading…
Reference in New Issue
Block a user