This is a false positive, because returning false from a method which yields still returns a Generator, see:
<?php
function foo(): Generator
{
return false;
yield "yolo";
}
var_dump(foo());
Output:
object(Generator)#1 (0) { }
See also https://3v4l.org/VcSpa