1
0
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:
Nikita Popov 2017-01-19 23:35:31 +01:00
parent 6238f5f9f9
commit a79306ccd9
4 changed files with 11 additions and 11 deletions

View File

@ -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');
}
}

View File

@ -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) : '');
}

View File

@ -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(

View File

@ -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(