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