@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | public function splitCsvFile(\Iterator $input, callable $callback) |
| 104 | 104 | { |
| 105 | 105 | $callback = \Closure::fromCallable($callback); |
| 106 | - $this->process($input, function ($row, $rowNum, $input, $output) use ($callback) { |
|
| 106 | + $this->process($input, function($row, $rowNum, $input, $output) use ($callback) { |
|
| 107 | 107 | if ($fileName = $callback($row)) { |
| 108 | 108 | if (!$output->isFileOpen($fileName)) { |
| 109 | 109 | $output->openFile($fileName)->fputcsv(array_keys($row)); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | { |
| 127 | 127 | $callback = \Closure::fromCallable($callback); |
| 128 | 128 | $input->rewind(); |
| 129 | - iterator_apply($input, function (\Iterator $iterator) use ($callback) { |
|
| 129 | + iterator_apply($input, function(\Iterator $iterator) use ($callback) { |
|
| 130 | 130 | $callback($iterator->current(), $iterator->key(), $iterator, $this); |
| 131 | 131 | return true; |
| 132 | 132 | }, [$input]); |
@@ -33,6 +33,9 @@ |
||
| 33 | 33 | return $sortedIterator; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | + /** |
|
| 37 | + * @param \Traversable $iterator |
|
| 38 | + */ |
|
| 36 | 39 | protected function generateElement($key, $value, $iterator) |
| 37 | 40 | { |
| 38 | 41 | return (object) ['key' => $key, 'current' => $value]; |