Skip to content

Commit

Permalink
Fix crash with union/intersection types.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrolGenhald committed Feb 3, 2022
1 parent 5bc48b2 commit aa81e4b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit aa81e4b

Please sign in to comment.