From aa81e4be78a1bde5db542c615e095d79dccd9a76 Mon Sep 17 00:00:00 2001 From: AndrolGenhald Date: Thu, 3 Feb 2022 17:43:19 -0600 Subject: [PATCH] Fix crash with union/intersection types. --- .../LaminasCode/ParameterReflection.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PHPExtensionStubGenerator/LaminasCode/ParameterReflection.php b/src/PHPExtensionStubGenerator/LaminasCode/ParameterReflection.php index 431be07..5cd76dd 100644 --- a/src/PHPExtensionStubGenerator/LaminasCode/ParameterReflection.php +++ b/src/PHPExtensionStubGenerator/LaminasCode/ParameterReflection.php @@ -52,14 +52,14 @@ public function detectType(): ?string if ( method_exists($this, 'getType') && null !== ($type = $this->getType()) - && $type->isBuiltin() + // && $type->isBuiltin() ) { - return $type->getName(); + return (string) $type; } - if (null !== $type && $type->getName() === 'self') { - return $this->getDeclaringClass()->getName(); - } + // if (null !== $type && $type->getName() === 'self') { + // return $this->getDeclaringClass()->getName(); + // } if (($class = $this->getClass()) instanceof ReflectionClass) { return $class->getName();