Skip to content

Commit b3c99fa

Browse files
committed
direct check is built in
1 parent 3ad82c9 commit b3c99fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Reflection/Php/PhpMethodReflection.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,12 @@ private function getNativeReturnType(): Type
329329
if (in_array($this->getName(), ['__construct', '__destruct', '__unset', '__wakeup', '__clone'], true)) {
330330
return $this->nativeReturnType = new VoidType();
331331
}
332-
if ($name === '__tostring' && $this->declaringClass->isBuiltin()) {
333-
return $this->nativeReturnType = new StringType();
332+
if ($name === '__tostring') {
333+
if ($this->declaringClass->isBuiltin()) {
334+
return $this->nativeReturnType = new StringType();
335+
} else {
336+
return $this->nativeReturnType = new MixedType();
337+
}
334338
}
335339
if ($name === '__isset') {
336340
return $this->nativeReturnType = new BooleanType();

0 commit comments

Comments
 (0)