Skip to content

Commit ecf43ce

Browse files
authored
Merge pull request #48 from magento-commerce/fix_NullableType
fix NullableType
2 parents 1aaf057 + 40c95ba commit ecf43ce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Analyzer/ClassMethodAnalyzer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,11 @@ private function getDocReturnDeclaration(ClassMethod $method)
459459
($parsedComment = $method->getAttribute('docCommentParsed'))
460460
&& isset($parsedComment['return'])
461461
) {
462-
$result = implode('|', $parsedComment['return']);
462+
if ($parsedComment['return'][0] instanceof NullableType) {
463+
$result = '?' . $parsedComment['return'][0]->type;
464+
} else {
465+
$result = implode('|', $parsedComment['return']);
466+
}
463467

464468
return $result;
465469
} elseif ($this->dependencyGraph !== null) {

0 commit comments

Comments
 (0)