diff --git a/src/Kql/Help.php b/src/Kql/Help.php index faa6f21..1bae4a8 100644 --- a/src/Kql/Help.php +++ b/src/Kql/Help.php @@ -57,13 +57,13 @@ public static function forArray(array $array): array public static function forMethod(object $object, string $method): array { $reflection = new ReflectionMethod($object, $method); - $returns = $reflection->getReturnType()?->getName(); + $returns = $reflection->getReturnType() ? (string)$reflection->getReturnType(): null; $params = []; foreach ($reflection->getParameters() as $param) { $name = $param->getName(); $required = $param->isOptional() === false; - $type = $param->hasType() ? $param->getType()->getName() : null; + $type = $param->hasType() ? (string)$param->getType() : null; $default = null; if ($param->isDefaultValueAvailable()) {