zip = new \ZipArchive(); if ($this->zip->open($filePath) === true) { $this->sheetIterator = new SheetIterator($filePath); } else { throw new IOException("Could not open $filePath for reading."); } } /** * Returns an iterator to iterate over sheets. * * @return SheetIterator To iterate over sheets */ public function getConcreteSheetIterator() { return $this->sheetIterator; } /** * Closes the reader. To be used after reading the file. * * @return void */ protected function closeReader() { if ($this->zip) { $this->zip->close(); } } }