From aca093dd979f607db504dc319db4b6e4edbbfb53 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Tue, 7 Feb 2023 16:50:16 +0000 Subject: [PATCH] - Fixed a bug with Union types within methods arguments --- src/ObjectReflection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,