Skip to content

Commit d7c9859

Browse files
committed
Fix
1 parent 3dcce49 commit d7c9859

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/src/integration/types.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,18 @@ function toStr(ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionTyp
2525
return '<null>';
2626
}
2727
return match (true) {
28-
$v instanceof ReflectionNamedType => $v->allowsNull() ? '?'.$v->getName() : $v->getName(),
28+
$v instanceof ReflectionNamedType => $v->allowsNull() && $v->getName() !== 'mixed' ? '?'.$v->getName() : $v->getName(),
2929
$v instanceof ReflectionUnionType => $v->getName(),
3030
$v instanceof ReflectionIntersectionType => $v->getName(),
3131
};
3232
}
3333

3434
foreach (TYPES as $func => [$args, $return]) {
3535
$f = new ReflectionFunction($func);
36-
assert(toStr($f->getReturnType()) === $return, "Wrong return type of $func, expected $return, got ".((string)$f->getReturnType()));
36+
$tReturn = toStr($f->getReturnType());
37+
assert($tReturn === $return, "Wrong return type of $func, expected $return, got $tReturn");
3738
foreach ($f->getParameters() as $idx => $param) {
38-
assert(toStr($param->getType()) === $args[$idx], "Wrong arg type $idx of $func, expected {$args[$idx]}, got ".((string)$param->getType()));
39+
$tParam = toStr($param->getType());
40+
assert($tParam === $args[$idx], "Wrong arg type $idx of $func, expected {$args[$idx]}, got $tParam");
3941
}
4042
}

0 commit comments

Comments
 (0)