rabol implemented for most common cases;
We've annotated both RecursiveIteratorIterator and IteratorIterator with a generic argument that will be inferred in most cases automatically, and added a @mixin annotation.
The code above will work out of the box.
In case, the PHP editor won't be able to infer the inner iterator, please annotate the $it variable with doc comment, i.e.:
/** @var RecursiveIteratorIterator&RecursiveDirectoryIterator $it */