Skip to content

Commit ecf0374

Browse files
committed
Catch fatal exceptions.
1 parent 6cf341d commit ecf0374

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/DefinitionResolver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,7 @@ public function getTypeFromNode($node)
11281128
if (
11291129
$docBlock !== null
11301130
&& !empty($returnTags = $docBlock->getTagsByName('return'))
1131+
&& $returnTags[0] instanceof DocBlock\Tags\Return_
11311132
&& $returnTags[0]->getType() !== null
11321133
) {
11331134
// Use @return tag
@@ -1354,7 +1355,7 @@ private function tryGetDocBlockTagForParameter($docBlock, $variableName)
13541355
}
13551356
$tags = $docBlock->getTagsByName('param');
13561357
foreach ($tags as $tag) {
1357-
if ($tag->getVariableName() === \ltrim($variableName, "$")) {
1358+
if ($tag instanceof DocBlock\Tags\Param && $tag->getVariableName() === \ltrim($variableName, "$")) {
13581359
return $tag;
13591360
}
13601361
}

0 commit comments

Comments
 (0)