code: protected function readCSVRows($stream)
      {
          $rows = [];
          while ($row = \fgetcsv($stream)) {
              if ($row === [NULL]) {
                  $row = [];
              }
              $rows[] = $row;
          }
  
          if ( ! \array_filter($rows)) {
              throw new \InvalidArgumentException('The provided CSV was empty');
          }
  
          return $rows;
      }
docs: @param resource $stream
  
  @return array