1
0
mirror of https://github.com/nikic/PHP-Parser.git synced 2025-05-13 08:45:18 +02:00

Fix ClassConst::$type phpdoc

The property should be nullable, and on 4.x we should convert
string to Identifier.

Fixes .
This commit is contained in:
Nikita Popov 2023-08-13 21:49:54 +02:00
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;
/**
@ -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 {