*/ interface CursorInterface extends Traversable { /** * @return array */ public function toArray(); } /** * @template-covariant TValue of array|object * * @template-implements Iterator * @template-implements CursorInterface */ final class Cursor implements CursorInterface, Iterator { /** * @return TValue */ public function current() {} /** * @return void */ public function next() {} /** * @return int */ public function key() {} /** * @return bool */ public function valid() {} /** * @return void */ public function rewind() {} /** * @return array */ public function toArray() {} }