Skip to content

Commit

Permalink
Merge pull request #48 from magento-commerce/fix_NullableType
Browse files Browse the repository at this point in the history
fix NullableType
  • Loading branch information
duhon committed Nov 3, 2023
2 parents 1aaf057 + 40c95ba commit ecf43ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Analyzer/ClassMethodAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,11 @@ private function getDocReturnDeclaration(ClassMethod $method)
($parsedComment = $method->getAttribute('docCommentParsed'))
&& isset($parsedComment['return'])
) {
$result = implode('|', $parsedComment['return']);
if ($parsedComment['return'][0] instanceof NullableType) {
$result = '?' . $parsedComment['return'][0]->type;
} else {
$result = implode('|', $parsedComment['return']);
}

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

0 comments on commit ecf43ce

Please sign in to comment.