@@ -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]); |
@@ -12,6 +12,9 @@ |
||
12 | 12 | parent::__construct($this->getShuffledIterator($iterator)); |
13 | 13 | } |
14 | 14 | |
15 | + /** |
|
16 | + * @param \Traversable $iterator |
|
17 | + */ |
|
15 | 18 | public function getShuffledIterator($iterator) |
16 | 19 | { |
17 | 20 | $sortedIterator = new \ArrayIterator(); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | // The outer iterator is a finite replaceable iterator with a condition |
44 | 44 | // on the inner iterator not being empty. |
45 | - parent::__construct(new InfiniteIterator(new ReplaceableIterator(), function ($iterator) { |
|
45 | + parent::__construct(new InfiniteIterator(new ReplaceableIterator(), function($iterator) { |
|
46 | 46 | return !$iterator->current()->valid(); |
47 | 47 | })); |
48 | 48 | } |