diff --git a/src/Reflection/Php/PhpClassReflectionExtension.php b/src/Reflection/Php/PhpClassReflectionExtension.php index 85489b2e9b..eac15ef626 100644 --- a/src/Reflection/Php/PhpClassReflectionExtension.php +++ b/src/Reflection/Php/PhpClassReflectionExtension.php @@ -853,10 +853,12 @@ private function createNativeMethodVariant( ); } - $returnType = null; if ($stubPhpDocReturnType !== null) { $returnType = $stubPhpDocReturnType; $phpDocReturnType = $stubPhpDocReturnType; + } else { + // debug + $returnType = TypehintHelper::decideType($methodSignature->getReturnType(), $phpDocReturnType); } return new FunctionVariantWithPhpDocs( @@ -864,7 +866,7 @@ private function createNativeMethodVariant( null, $parameters, $methodSignature->isVariadic(), - $returnType ?? $methodSignature->getReturnType(), + $returnType, $phpDocReturnType ?? new MixedType(), $methodSignature->getNativeReturnType(), );