Skip to content

Commit 9e9d38f

Browse files
committed
direct check is built in
1 parent dad63c7 commit 9e9d38f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Reflection/Php/PhpMethodReflection.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,11 @@ private function getNativeReturnType(): Type
332332
if ($name === '__tostring') {
333333
return $this->nativeReturnType = $this->declaringClass->isBuiltin()
334334
? new StringType()
335-
: new MixedType();
335+
: TypehintHelper::decideTypeFromReflection(
336+
$returnType,
337+
null,
338+
$this->declaringClass,
339+
);
336340
}
337341
if ($name === '__isset') {
338342
return $this->nativeReturnType = new BooleanType();

0 commit comments

Comments
 (0)