mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-04-24 16:02:05 +02:00
Fix ClassConst::$type phpdoc
The property should be nullable, and on 4.x we should convert string to Identifier. Fixes #939.
This commit is contained in:
parent
844c228bf2
commit
44fc92194b
@ -12,7 +12,7 @@ class ClassConst extends Node\Stmt
|
||||
public $consts;
|
||||
/** @var Node\AttributeGroup[] PHP attribute groups */
|
||||
public $attrGroups;
|
||||
/** @var Node\Identifier|Node\Name|Node\ComplexType Type declaration */
|
||||
/** @var Node\Identifier|Node\Name|Node\ComplexType|null Type declaration */
|
||||
public $type;
|
||||
|
||||
/**
|
||||
@ -22,7 +22,7 @@ class ClassConst extends Node\Stmt
|
||||
* @param int $flags Modifiers
|
||||
* @param array $attributes Additional attributes
|
||||
* @param Node\AttributeGroup[] $attrGroups PHP attribute groups
|
||||
* @param null|string|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration
|
||||
* @param null|string|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration
|
||||
*/
|
||||
public function __construct(
|
||||
array $consts,
|
||||
@ -35,7 +35,7 @@ class ClassConst extends Node\Stmt
|
||||
$this->flags = $flags;
|
||||
$this->consts = $consts;
|
||||
$this->attrGroups = $attrGroups;
|
||||
$this->type = $type;
|
||||
$this->type = \is_string($type) ? new Node\Identifier($type) : $type;
|
||||
}
|
||||
|
||||
public function getSubNodeNames() : array {
|
||||
|
Loading…
x
Reference in New Issue
Block a user