public function handleFile(ReaderInterface $reader, $path)
 {
     $reader->open($path);
     $output = [];
     while ($reader->hasNextRow()) {
         $output[] = $reader->nextRow();
     }
     $reader->close();
     return $output;
 }
Ejemplo n.º 2
0
 /**
  * Close reader and remove folder created when archive has been extracted
  */
 public function __destruct()
 {
     if (null !== $this->reader) {
         $this->reader->close();
     }
     if (null !== $this->archivePath) {
         $fileSystem = new Filesystem();
         $fileSystem->remove($this->archivePath);
         $this->archivePath = null;
     }
 }