@@ -263,7 +263,7 @@ |
||
263 | 263 | /** |
264 | 264 | * {@inheritdoc} |
265 | 265 | */ |
266 | - public function forEach(callable $consumer): void |
|
266 | + public function forEach (callable $consumer): void |
|
267 | 267 | { |
268 | 268 | foreach ($this->keys as $hash => $key) { |
269 | 269 | $consumer($this->values[$hash], $key); |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | $stream = new ArrayStream($this->data); |
36 | 36 | |
37 | 37 | return $stream |
38 | - ->filter(function ($e) { return $e->id % 3 === 0; }) |
|
39 | - ->map(function ($e) { return $e->sub; }) |
|
38 | + ->filter(function($e) { return $e->id % 3 === 0; }) |
|
39 | + ->map(function($e) { return $e->sub; }) |
|
40 | 40 | ->distinct() |
41 | 41 | ->toArray() |
42 | 42 | ; |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $stream = new MutableArrayStream($this->data); |
51 | 51 | |
52 | 52 | return $stream |
53 | - ->filter(function ($e) { return $e->id % 3 === 0; }) |
|
54 | - ->map(function ($e) { return $e->sub; }) |
|
53 | + ->filter(function($e) { return $e->id % 3 === 0; }) |
|
54 | + ->map(function($e) { return $e->sub; }) |
|
55 | 55 | ->distinct() |
56 | 56 | ->toArray() |
57 | 57 | ; |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | |
67 | 67 | return array_unique( |
68 | 68 | array_map( |
69 | - function ($e) { return $e->sub; }, |
|
70 | - array_filter($array, function ($e) { return $e->id % 3 === 0; }) |
|
69 | + function($e) { return $e->sub; }, |
|
70 | + array_filter($array, function($e) { return $e->id % 3 === 0; }) |
|
71 | 71 | ), |
72 | 72 | SORT_REGULAR |
73 | 73 | ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function bench_reduce_with_closure() |
88 | 88 | { |
89 | - return (new ArrayStream(range(0, 100)))->reduce(function ($a, $b) { return $a + $b; }); |
|
89 | + return (new ArrayStream(range(0, 100)))->reduce(function($a, $b) { return $a + $b; }); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function bench_map_getter_closure() |
104 | 104 | { |
105 | - return (new ArrayStream($this->data))->map(function ($e) { return $e->sub(); })->toArray(); |
|
105 | + return (new ArrayStream($this->data))->map(function($e) { return $e->sub(); })->toArray(); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -108,7 +108,7 @@ |
||
108 | 108 | * |
109 | 109 | * @param callable(T, K=):void $consumer |
110 | 110 | */ |
111 | - public function forEach(callable $consumer): void; |
|
111 | + public function forEach (callable $consumer): void; |
|
112 | 112 | |
113 | 113 | /** |
114 | 114 | * {@inheritdoc} |
@@ -70,6 +70,6 @@ |
||
70 | 70 | */ |
71 | 71 | public function finalize(): string |
72 | 72 | { |
73 | - return $this->prefix.(string)$this->aggregation.$this->suffix; |
|
73 | + return $this->prefix.(string) $this->aggregation.$this->suffix; |
|
74 | 74 | } |
75 | 75 | } |
@@ -55,5 +55,5 @@ |
||
55 | 55 | * |
56 | 56 | * @param callable(T, int=):void $consumer |
57 | 57 | */ |
58 | - public function forEach(callable $consumer): void; |
|
58 | + public function forEach (callable $consumer): void; |
|
59 | 59 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | /** |
88 | 88 | * {@inheritdoc} |
89 | 89 | */ |
90 | - public function forEach(callable $consumer): void |
|
90 | + public function forEach (callable $consumer): void |
|
91 | 91 | { |
92 | 92 | foreach ($this->toArray() as $k => $v) { |
93 | 93 | $consumer($v, $k); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } else { |
196 | 196 | usort($data, $this->comparator); |
197 | 197 | } |
198 | - } elseif($this->preserveKeys) { |
|
198 | + } elseif ($this->preserveKeys) { |
|
199 | 199 | asort($data); |
200 | 200 | } else { |
201 | 201 | sort($data); |