I have only tested this with int|string, so I don't know if other types are affected as well.
If an argument is of two types, checking against one type does not narrow it afterwards.
In the example below, int|string should have been narrowed to string, because int would have returned already.
public static function findByIdOrPath(int|string $idOrPath): void
{
if (is_int($idOrPath)) {
return self::find($idOrPath);
}
$idOrPath; // Hover shows int|string, wrong, should be string
if (!is_int($idOrPath)) {
return self::find($idOrPath);
}
$idOrPath; // Hover shows int, correct
}