Skip to content

Commit 3b20c35

Browse files
committed
Only set return native type from null return type when declaring class is built in
1 parent ea7072c commit 3b20c35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Reflection/Php/PhpMethodReflection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ private function getNativeReturnType(): Type
324324
{
325325
if ($this->nativeReturnType === null) {
326326
$returnType = $this->reflection->getReturnType();
327-
if ($returnType === null) {
327+
if ($returnType === null && $this->declaringClass->isBuiltin()) {
328328
$name = strtolower($this->getName());
329329
if (in_array($this->getName(), ['__construct', '__destruct', '__unset', '__wakeup', '__clone'], true)) {
330330
return $this->nativeReturnType = new VoidType();

0 commit comments

Comments
 (0)