| 1 |
<?php declare(strict_types=1); |
| 2 |
|
| 3 |
namespace PhpParser\Node\Stmt; |
| 4 |
|
| 5 |
use PhpParser\Node; |
| 6 |
use PhpParser\Node\Expr; |
| 7 |
|
| 8 |
class StaticVar extends Node\Stmt |
| 9 |
{ |
| 10 |
/** @var Expr\Variable Variable */ |
| 11 |
public $var; |
| 12 |
/** @var null|Node\Expr Default value */ |
| 13 |
public $default; |
| 14 |
|
| 15 |
/** |
| 16 |
* Constructs a static variable node. |
| 17 |
* |
| 18 |
* @param Expr\Variable $var Name |
| 19 |
* @param null|Node\Expr $default Default value |
| 20 |
* @param array $attributes Additional attributes |
| 21 |
*/ |
| 22 |
public function __construct( |
| 23 |
Expr\Variable $var, ?Node\Expr $default = null, array $attributes = [] |
| 24 |
) { |
| 25 |
$this->attributes = $attributes; |
| 26 |
$this->var = $var; |
| 27 |
$this->default = $default; |
| 28 |
} |
| 29 |
|
| 30 |
public function getSubNodeNames() : array { |
| 31 |
return ['var', 'default']; |
| 32 |
} |
| 33 |
|
| 34 |
public function getType() : string { |
| 35 |
return 'Stmt_StaticVar'; |
| 36 |
} |
| 37 |
} |
| 38 |
|