Skip to content

Commit

Permalink
Merge pull request #484 from jakublabno/patch-1
Browse files Browse the repository at this point in the history
[FIX] Library generates non-nullable return type for nullable return …
  • Loading branch information
lisachenko authored Feb 7, 2024
2 parents 501d013 + 6d20cfc commit b10821b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Proxy/Part/InterceptedMethodGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(ReflectionMethod $reflectionMethod, string $body, bo
if ($reflectionMethod->hasReturnType()) {
$reflectionReturnType = $reflectionMethod->getReturnType();
if ($reflectionReturnType instanceof ReflectionNamedType) {
$returnTypeName = $reflectionReturnType->getName();
$returnTypeName = ($reflectionReturnType->allowsNull() ? '?' : '') . $reflectionReturnType->getName();
} else {
$returnTypeName = (string)$reflectionReturnType;
}
Expand Down

0 comments on commit b10821b

Please sign in to comment.