From 10791908aa2c40ef311fbf4103f49de8de4e042c Mon Sep 17 00:00:00 2001 From: Vladislav Osmianskij Date: Mon, 14 Feb 2022 08:07:45 +0200 Subject: [PATCH] fix: better reporting unfinished property declaration --- runtime/Compilation/Class_.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/Compilation/Class_.php b/runtime/Compilation/Class_.php index 4262aa6..0b6d68f 100644 --- a/runtime/Compilation/Class_.php +++ b/runtime/Compilation/Class_.php @@ -9,6 +9,7 @@ use Osm\Runtime\Compilation\Methods\Merged as MergedMethod; use Osm\Runtime\Object_; use Osm\Runtime\Traits\Serializable; +use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag; use phpDocumentor\Reflection\DocBlock\Tags\Property as PhpDocProperty; use phpDocumentor\Reflection\DocBlockFactory; use phpDocumentor\Reflection\Types\Context; @@ -164,6 +165,11 @@ protected function get_doc_comment_properties() : array { } foreach ($docBlock->getTagsByName('property') as $property) { + if ($property instanceof InvalidTag) { + throw new \Exception("{$this->name}: unfinished " . + "property declaration or {$property->getException()}"); + } + /* @var PhpDocProperty $property */ $properties[$property->getVariableName()] = $this->loadDocBlockProperty($property);