Passed
Push — master ( 398a67...caa005 )
by Maxim
02:40
created
src/WS/Utils/Collections/SerialStream.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     public function reorganize(callable $reorganizer): Stream
54 54
     {
55 55
         $reorganizedCollection = $reorganizer($this->list);
56
-        if (! $reorganizedCollection instanceof Collection) {
56
+        if (!$reorganizedCollection instanceof Collection) {
57 57
             throw new RuntimeException('Result set of reorganizer call must be instance of Collection interface');
58 58
         }
59 59
         $this->list = $reorganizedCollection;
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     {
124 124
         $values = [];
125 125
         $map = [];
126
-        $this->each(static function ($el) use ($extractor, & $map, & $values) {
126
+        $this->each(static function($el) use ($extractor, & $map, & $values) {
127 127
             $value = $extractor($el);
128 128
             if (!is_scalar($value)) {
129 129
                 throw new RuntimeException('Only scalar value can be as result of sort extractor');
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
         $size = $this->list->size();
167 167
         /** @var ListSequence $list */
168 168
         $list = $this->list->copy();
169
-        $this->walk(static function ($head, $index) use ($list, $size) {
169
+        $this->walk(static function($head, $index) use ($list, $size) {
170 170
             $tailIndex = $size - $index - 1;
171 171
             $tail = $list->get($tailIndex);
172 172
             $list->set($tail, $index);
173 173
             $list->set($head, $tailIndex);
174
-        }, (int)($size/2));
174
+        }, (int)($size / 2));
175 175
         $this->list = $list;
176 176
 
177 177
         return $this;
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     public function limit(int $size): Stream
304 304
     {
305 305
         $newCollection = $this->emptyList();
306
-        $this->walk(static function ($el) use ($newCollection) {
306
+        $this->walk(static function($el) use ($newCollection) {
307 307
             $newCollection->add($el);
308 308
         }, $size);
309 309
 
Please login to merge, or discard this patch.
src/WS/Utils/Collections/Functions/Predicates.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public static function lock(): Closure
19 19
     {
20
-        return static function (): bool {
20
+        return static function(): bool {
21 21
             return false;
22 22
         };
23 23
     }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public static function notNull(): Closure
30 30
     {
31
-        return static function ($el): bool {
31
+        return static function($el): bool {
32 32
             return $el !== null;
33 33
         };
34 34
     }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public static function notResistance(): Closure
41 41
     {
42
-        return static function (): bool {
42
+        return static function(): bool {
43 43
             return true;
44 44
         };
45 45
     }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     public static function eachEven(): Closure
52 52
     {
53 53
         $isEven = false;
54
-        return static function () use (& $isEven) {
54
+        return static function() use (& $isEven) {
55 55
             $res = $isEven;
56 56
             $isEven = !$isEven;
57 57
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     public static function nth($number): Closure
68 68
     {
69 69
         $counter = 0;
70
-        return static function () use ($number, & $counter) {
70
+        return static function() use ($number, & $counter) {
71 71
             $res = ++$counter % $number === 0;
72 72
             if ($res) {
73 73
                 $counter = 0;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public static function equal($value): Closure
85 85
     {
86
-        return static function ($el) use ($value): bool {
86
+        return static function($el) use ($value): bool {
87 87
             return $el === $value;
88 88
         };
89 89
     }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     public static function lockDuplicated(): Closure
95 95
     {
96 96
         $set = new HashSet();
97
-        return static function ($el) use ($set): bool {
97
+        return static function($el) use ($set): bool {
98 98
             $res = !$set->contains($el);
99 99
             $set->add($el);
100 100
             return $res;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public static function lessThan($value): Closure
110 110
     {
111
-        return static function ($el) use ($value): bool {
111
+        return static function($el) use ($value): bool {
112 112
             return $el < $value;
113 113
         };
114 114
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public static function lessOrEqual($value): Closure
122 122
     {
123
-        return static function ($el) use ($value): bool {
123
+        return static function($el) use ($value): bool {
124 124
             return $el <= $value;
125 125
         };
126 126
     }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public static function greaterThan($value): Closure
134 134
     {
135
-        return static function ($el) use ($value): bool {
135
+        return static function($el) use ($value): bool {
136 136
             return $el > $value;
137 137
         };
138 138
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     public static function greaterOrEqual($value): Closure
146 146
     {
147
-        return static function ($el) use ($value): bool {
147
+        return static function($el) use ($value): bool {
148 148
             return $el >= $value;
149 149
         };
150 150
     }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public static function not($value): Closure
158 158
     {
159
-        return static function ($el) use ($value): bool {
159
+        return static function($el) use ($value): bool {
160 160
             return $el !== $value;
161 161
         };
162 162
     }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public static function in(array $values): Closure
170 170
     {
171
-        return static function ($el) use ($values): bool {
171
+        return static function($el) use ($values): bool {
172 172
             return in_array($el, $values, true);
173 173
         };
174 174
     }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      */
181 181
     public static function notIn(array $values): Closure
182 182
     {
183
-        return static function ($el) use ($values): bool {
183
+        return static function($el) use ($values): bool {
184 184
             return !in_array($el, $values, true);
185 185
         };
186 186
     }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     public static function where(string $property, $value): Closure
195 195
     {
196
-        return static function ($ob) use ($property, $value) {
196
+        return static function($ob) use ($property, $value) {
197 197
             return $value === ObjectFunctions::getPropertyValue($ob, $property);
198 198
         };
199 199
     }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
      */
207 207
     public static function whereNot(string $property, $value): Closure
208 208
     {
209
-        return static function ($ob) use ($property, $value) {
209
+        return static function($ob) use ($property, $value) {
210 210
             return $value !== ObjectFunctions::getPropertyValue($ob, $property);
211 211
         };
212 212
     }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      */
220 220
     public static function whereIn(string $property, array $values): Closure
221 221
     {
222
-        return static function ($ob) use ($property, $values) {
222
+        return static function($ob) use ($property, $values) {
223 223
             return in_array(ObjectFunctions::getPropertyValue($ob, $property), $values, true);
224 224
         };
225 225
     }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      */
233 233
     public static function whereNotIn(string $property, array $values): Closure
234 234
     {
235
-        return static function ($ob) use ($property, $values) {
235
+        return static function($ob) use ($property, $values) {
236 236
             return !in_array(ObjectFunctions::getPropertyValue($ob, $property), $values, true);
237 237
         };
238 238
     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      */
246 246
     public static function whereGreaterThan(string $property, $value): Closure
247 247
     {
248
-        return static function ($ob) use ($property, $value) {
248
+        return static function($ob) use ($property, $value) {
249 249
             return ObjectFunctions::getPropertyValue($ob, $property) > $value;
250 250
         };
251 251
     }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      */
259 259
     public static function whereLessThan(string $property, $value): Closure
260 260
     {
261
-        return static function ($ob) use ($property, $value) {
261
+        return static function($ob) use ($property, $value) {
262 262
             return ObjectFunctions::getPropertyValue($ob, $property) < $value;
263 263
         };
264 264
     }
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      */
272 272
     public static function whereGreaterOrEqual(string $property, $value): Closure
273 273
     {
274
-        return static function ($ob) use ($property, $value) {
274
+        return static function($ob) use ($property, $value) {
275 275
             return ObjectFunctions::getPropertyValue($ob, $property) >= $value;
276 276
         };
277 277
     }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      */
285 285
     public static function whereLessOrEqual(string $property, $value): Closure
286 286
     {
287
-        return static function ($ob) use ($property, $value) {
287
+        return static function($ob) use ($property, $value) {
288 288
             return ObjectFunctions::getPropertyValue($ob, $property) <= $value;
289 289
         };
290 290
     }
Please login to merge, or discard this patch.