entityFactory; $this->zip = $entityFactory->createZipArchive(); if (true === $this->zip->open($filePath)) { /** @var InternalEntityFactory $entityFactory */ $entityFactory = $this->entityFactory; $this->sheetIterator = $entityFactory->createSheetIterator($filePath, $this->optionsManager); } else { throw new IOException("Could not open {$filePath} for reading."); } } /** * Returns an iterator to iterate over sheets. * * @return SheetIterator To iterate over sheets */ protected function getConcreteSheetIterator() { return $this->sheetIterator; } /** * Closes the reader. To be used after reading the file. */ protected function closeReader() { if (null !== $this->zip) { $this->zip->close(); } } }