Skip to content

Commit

Permalink
fix: better reporting unfinished property declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
osmianski committed Feb 14, 2022
1 parent e0fb183 commit 1079190
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runtime/Compilation/Class_.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1079190

Please sign in to comment.