As one might notice, this class does not implement a hasNext() or next() method as opposed to the now deprecated Mongo driver.
If, for any reason, you need to pull data from the cursor procedurally or otherwise need to override the behavior of foreach while iterating on the cursor, the SPL \IteratorIterator class can be used. When doing so, it is important to rewind the iterator before using it, otherwise you won't get any data back.
<?php
$cursor = $collection->find();
$it = new \IteratorIterator($cursor);
$it->rewind(); while($doc = $it->current()) {
var_dump($doc);
$it->next();
}
?>
I used this trick to build a backward compatibility wrapper emulating the old Mongo driver in order to upgrade an older codebase.