diff --git a/lib/PhpParser/Node/Stmt/ClassConst.php b/lib/PhpParser/Node/Stmt/ClassConst.php index 52b804c4..8abaad6d 100644 --- a/lib/PhpParser/Node/Stmt/ClassConst.php +++ b/lib/PhpParser/Node/Stmt/ClassConst.php @@ -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 {