diff --git a/src/ObjectReflection.php b/src/ObjectReflection.php index ee77434..bba00cf 100644 --- a/src/ObjectReflection.php +++ b/src/ObjectReflection.php @@ -168,7 +168,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,