/** * Returns the current element. * * @return \SplFileInfo * * @throws FileSystemException If called after the last element has been returned. */ public function current() { try { return $this->iterator->current(); } catch (\RuntimeException $e) { throw FileSystemException::wrap($e); } }