diff --git a/src/ObjectReflection.php b/src/ObjectReflection.php index 661a0ff..aa72ef9 100644 --- a/src/ObjectReflection.php +++ b/src/ObjectReflection.php @@ -167,7 +167,7 @@ class ObjectReflection { $current = [ 'name' => $method->getName(), - 'type' => $method->hasReturnType() ? $method->getReturnType()->getName() : false, + 'type' => $method->hasReturnType() && $method->getReturnType() instanceof \ReflectionNamedType ? $method->getReturnType()->getName() : false, 'constructor' => $method->isConstructor(), 'destructor' => $method->isDestructor(), 'parameters' => $parameters,