@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | function xrange(int $start, ?int $size = null, int $step = 1): Range |
| 21 | 21 | { |
| 22 | - if($size === null) { |
|
| 22 | + if ($size === null) { |
|
| 23 | 23 | [$start, $size] = [0, $start]; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -41,21 +41,21 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $result = new IndexedArray(); |
| 43 | 43 | |
| 44 | - if(count($collections) === 0) { |
|
| 44 | + if (count($collections) === 0) { |
|
| 45 | 45 | return $result; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - $it = new MultipleIterator(MultipleIterator::MIT_NEED_ALL|MultipleIterator::MIT_KEYS_NUMERIC); |
|
| 48 | + $it = new MultipleIterator(MultipleIterator::MIT_NEED_ALL | MultipleIterator::MIT_KEYS_NUMERIC); |
|
| 49 | 49 | |
| 50 | - foreach($collections as $collection) { |
|
| 51 | - if(is_array($collection)) { |
|
| 50 | + foreach ($collections as $collection) { |
|
| 51 | + if (is_array($collection)) { |
|
| 52 | 52 | $collection = new ArrayIterator($collection); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | $it->attachIterator(new IteratorIterator($collection)); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - foreach($it as $values) { |
|
| 58 | + foreach ($it as $values) { |
|
| 59 | 59 | $result[] = $mapper(...$values); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $result = new IndexedArray(); |
| 78 | 78 | |
| 79 | - foreach($collection as $item) { |
|
| 80 | - if($filter($item)) { |
|
| 79 | + foreach ($collection as $item) { |
|
| 80 | + if ($filter($item)) { |
|
| 81 | 81 | $result[] = $item; |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | $carry = $initialValue; |
| 103 | 103 | |
| 104 | - foreach($collection as $item) { |
|
| 104 | + foreach ($collection as $item) { |
|
| 105 | 105 | $carry = $reducer($carry, $item); |
| 106 | 106 | } |
| 107 | 107 | |