Passed
Branch master (bc1873)
by Yao
07:11
created
Category
src/LazyCollection.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             return new static;
62 62
         }
63 63
 
64
-        $instance = new static(function () use ($number) {
64
+        $instance = new static(function() use ($number) {
65 65
             for ($current = 1; $current <= $number; $current++) {
66 66
                 yield $current;
67 67
             }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public static function range($from, $to)
81 81
     {
82
-        return new static(function () use ($from, $to) {
82
+        return new static(function() use ($from, $to) {
83 83
             for (; $from <= $to; $from++) {
84 84
                 yield $from;
85 85
             }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
         $cache = [];
125 125
 
126
-        return new static(function () use ($iterator, &$iteratorIndex, &$cache) {
126
+        return new static(function() use ($iterator, &$iteratorIndex, &$cache) {
127 127
             for ($index = 0; true; $index++) {
128 128
                 if (array_key_exists($index, $cache)) {
129 129
                     yield $cache[$index][0] => $cache[$index][1];
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      */
189 189
     public function collapse()
190 190
     {
191
-        return new static(function () {
191
+        return new static(function() {
192 192
             foreach ($this as $values) {
193 193
                 if (is_array($values) || $values instanceof Enumerable) {
194 194
                     foreach ($values as $value) {
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
             ? $this->identity()
254 254
             : $this->valueRetriever($countBy);
255 255
 
256
-        return new static(function () use ($countBy) {
256
+        return new static(function() use ($countBy) {
257 257
             $counts = [];
258 258
 
259 259
             foreach ($this as $key => $value) {
@@ -382,12 +382,12 @@  discard block
 block discarded – undo
382 382
     public function filter(callable $callback = null)
383 383
     {
384 384
         if (is_null($callback)) {
385
-            $callback = function ($value) {
386
-                return (bool)$value;
385
+            $callback = function($value) {
386
+                return (bool) $value;
387 387
             };
388 388
         }
389 389
 
390
-        return new static(function () use ($callback) {
390
+        return new static(function() use ($callback) {
391 391
             foreach ($this as $key => $value) {
392 392
                 if ($callback($value, $key)) {
393 393
                     yield $key => $value;
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
      */
433 433
     public function flatten($depth = INF)
434 434
     {
435
-        $instance = new static(function () use ($depth) {
435
+        $instance = new static(function() use ($depth) {
436 436
             foreach ($this as $item) {
437 437
                 if (!is_array($item) && !$item instanceof Enumerable) {
438 438
                     yield $item;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
      */
455 455
     public function flip()
456 456
     {
457
-        return new static(function () {
457
+        return new static(function() {
458 458
             foreach ($this as $key => $value) {
459 459
                 yield $value => $key;
460 460
             }
@@ -503,14 +503,14 @@  discard block
 block discarded – undo
503 503
      */
504 504
     public function keyBy($keyBy)
505 505
     {
506
-        return new static(function () use ($keyBy) {
506
+        return new static(function() use ($keyBy) {
507 507
             $keyBy = $this->valueRetriever($keyBy);
508 508
 
509 509
             foreach ($this as $key => $item) {
510 510
                 $resolvedKey = $keyBy($item, $key);
511 511
 
512 512
                 if (is_object($resolvedKey)) {
513
-                    $resolvedKey = (string)$resolvedKey;
513
+                    $resolvedKey = (string) $resolvedKey;
514 514
                 }
515 515
 
516 516
                 yield $resolvedKey => $item;
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
      */
602 602
     public function keys()
603 603
     {
604
-        return new static(function () {
604
+        return new static(function() {
605 605
             foreach ($this as $key => $value) {
606 606
                 yield $key;
607 607
             }
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
      */
638 638
     public function pluck($value, $key = null)
639 639
     {
640
-        return new static(function () use ($value, $key) {
640
+        return new static(function() use ($value, $key) {
641 641
             [$value, $key] = $this->explodePluckParameters($value, $key);
642 642
 
643 643
             foreach ($this as $item) {
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
                     $itemKey = data_get($item, $key);
650 650
 
651 651
                     if (is_object($itemKey) && method_exists($itemKey, '__toString')) {
652
-                        $itemKey = (string)$itemKey;
652
+                        $itemKey = (string) $itemKey;
653 653
                     }
654 654
 
655 655
                     yield $itemKey => $itemValue;
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
      */
667 667
     public function map(callable $callback)
668 668
     {
669
-        return new static(function () use ($callback) {
669
+        return new static(function() use ($callback) {
670 670
             foreach ($this as $key => $value) {
671 671
                 yield $key => $callback($value, $key);
672 672
             }
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
      */
697 697
     public function mapWithKeys(callable $callback)
698 698
     {
699
-        return new static(function () use ($callback) {
699
+        return new static(function() use ($callback) {
700 700
             foreach ($this as $key => $value) {
701 701
                 yield from $callback($value, $key);
702 702
             }
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
      */
734 734
     public function combine($values)
735 735
     {
736
-        return new static(function () use ($values) {
736
+        return new static(function() use ($values) {
737 737
             $values = $this->makeIterator($values);
738 738
 
739 739
             $errorMessage = 'Both parameters should have an equal number of elements';
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
      */
777 777
     public function nth($step, $offset = 0)
778 778
     {
779
-        return new static(function () use ($step, $offset) {
779
+        return new static(function() use ($step, $offset) {
780 780
             $position = 0;
781 781
 
782 782
             foreach ($this as $item) {
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
             $keys = is_array($keys) ? $keys : func_get_args();
804 804
         }
805 805
 
806
-        return new static(function () use ($keys) {
806
+        return new static(function() use ($keys) {
807 807
             if (is_null($keys)) {
808 808
                 yield from $this;
809 809
             } else {
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
      */
833 833
     public function concat($source)
834 834
     {
835
-        return (new static(function () use ($source) {
835
+        return (new static(function() use ($source) {
836 836
             yield from $this;
837 837
             yield from $source;
838 838
         }))->values();
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
      */
880 880
     public function replace($items)
881 881
     {
882
-        return new static(function () use ($items) {
882
+        return new static(function() use ($items) {
883 883
             $items = $this->getArrayableItems($items);
884 884
 
885 885
             foreach ($this as $key => $value) {
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
     {
931 931
         $predicate = $this->useAsCallable($value)
932 932
             ? $value
933
-            : function ($item) use ($value, $strict) {
933
+            : function($item) use ($value, $strict) {
934 934
                 return $strict ? $item === $value : $item == $value;
935 935
             };
936 936
 
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
      */
963 963
     public function skip($count)
964 964
     {
965
-        return new static(function () use ($count) {
965
+        return new static(function() use ($count) {
966 966
             $iterator = $this->getIterator();
967 967
 
968 968
             while ($iterator->valid() && $count--) {
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
     {
1001 1001
         $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
1002 1002
 
1003
-        return new static(function () use ($callback) {
1003
+        return new static(function() use ($callback) {
1004 1004
             $iterator = $this->getIterator();
1005 1005
 
1006 1006
             while ($iterator->valid() && $callback($iterator->current(), $iterator->key())) {
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
             return static::empty();
1057 1057
         }
1058 1058
 
1059
-        return new static(function () use ($size) {
1059
+        return new static(function() use ($size) {
1060 1060
             $iterator = $this->getIterator();
1061 1061
 
1062 1062
             while ($iterator->valid()) {
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
             return $this->passthru('take', func_get_args());
1166 1166
         }
1167 1167
 
1168
-        return new static(function () use ($limit) {
1168
+        return new static(function() use ($limit) {
1169 1169
             $iterator = $this->getIterator();
1170 1170
 
1171 1171
             while ($limit--) {
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
     {
1193 1193
         $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
1194 1194
 
1195
-        return new static(function () use ($callback) {
1195
+        return new static(function() use ($callback) {
1196 1196
             foreach ($this as $key => $item) {
1197 1197
                 if ($callback($item, $key)) {
1198 1198
                     break;
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
     {
1214 1214
         $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
1215 1215
 
1216
-        return $this->takeUntil(function ($item, $key) use ($callback) {
1216
+        return $this->takeUntil(function($item, $key) use ($callback) {
1217 1217
             return !$callback($item, $key);
1218 1218
         });
1219 1219
     }
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
      */
1227 1227
     public function tapEach(callable $callback)
1228 1228
     {
1229
-        return new static(function () use ($callback) {
1229
+        return new static(function() use ($callback) {
1230 1230
             foreach ($this as $key => $value) {
1231 1231
                 $callback($value, $key);
1232 1232
 
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
      */
1243 1243
     public function values()
1244 1244
     {
1245
-        return new static(function () {
1245
+        return new static(function() {
1246 1246
             foreach ($this as $item) {
1247 1247
                 yield $item;
1248 1248
             }
@@ -1262,8 +1262,8 @@  discard block
 block discarded – undo
1262 1262
     {
1263 1263
         $iterables = func_get_args();
1264 1264
 
1265
-        return new static(function () use ($iterables) {
1266
-            $iterators = Collection::make($iterables)->map(function ($iterable) {
1265
+        return new static(function() use ($iterables) {
1266
+            $iterators = Collection::make($iterables)->map(function($iterable) {
1267 1267
                 return $this->makeIterator($iterable);
1268 1268
             })->prepend($this->getIterator());
1269 1269
 
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
             return $this->passthru('pad', func_get_args());
1289 1289
         }
1290 1290
 
1291
-        return new static(function () use ($size, $value) {
1291
+        return new static(function() use ($size, $value) {
1292 1292
             $yielded = 0;
1293 1293
 
1294 1294
             foreach ($this as $index => $item) {
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
      */
1372 1372
     protected function passthru($method, array $params)
1373 1373
     {
1374
-        return new static(function () use ($method, $params) {
1374
+        return new static(function() use ($method, $params) {
1375 1375
             yield from $this->collect()->$method(...$params);
1376 1376
         });
1377 1377
     }
Please login to merge, or discard this patch.
src/Collection.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
     {
88 88
         $callback = $this->valueRetriever($callback);
89 89
 
90
-        $items = $this->map(function ($value) use ($callback) {
90
+        $items = $this->map(function($value) use ($callback) {
91 91
             return $callback($value);
92
-        })->filter(function ($value) {
92
+        })->filter(function($value) {
93 93
             return !is_null($value);
94 94
         });
95 95
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     public function median($key = null)
108 108
     {
109 109
         $values = (isset($key) ? $this->pluck($key) : $this)
110
-            ->filter(function ($item) {
110
+            ->filter(function($item) {
111 111
                 return !is_null($item);
112 112
             })->sort()->values();
113 113
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             return null;
118 118
         }
119 119
 
120
-        $middle = (int)($count / 2);
120
+        $middle = (int) ($count / 2);
121 121
 
122 122
         if ($count % 2) {
123 123
             return $values->get($middle);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
         $counts = new static;
146 146
 
147
-        $collection->each(function ($value) use ($counts) {
147
+        $collection->each(function($value) use ($counts) {
148 148
             $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1;
149 149
         });
150 150
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
         $highestValue = $sorted->last();
154 154
 
155
-        return $sorted->filter(function ($value) use ($highestValue) {
155
+        return $sorted->filter(function($value) use ($highestValue) {
156 156
             return $value == $highestValue;
157 157
         })->sort()->keys()->all();
158 158
     }
@@ -320,12 +320,12 @@  discard block
 block discarded – undo
320 320
     protected function duplicateComparator($strict)
321 321
     {
322 322
         if ($strict) {
323
-            return function ($a, $b) {
323
+            return function($a, $b) {
324 324
                 return $a === $b;
325 325
             };
326 326
         }
327 327
 
328
-        return function ($a, $b) {
328
+        return function($a, $b) {
329 329
             return $a == $b;
330 330
         };
331 331
     }
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
      */
404 404
     public function forget($keys)
405 405
     {
406
-        foreach ((array)$keys as $key) {
406
+        foreach ((array) $keys as $key) {
407 407
             $this->offsetUnset($key);
408 408
         }
409 409
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
             }
454 454
 
455 455
             foreach ($groupKeys as $groupKey) {
456
-                $groupKey = is_bool($groupKey) ? (int)$groupKey : $groupKey;
456
+                $groupKey = is_bool($groupKey) ? (int) $groupKey : $groupKey;
457 457
 
458 458
                 if (!array_key_exists($groupKey, $results)) {
459 459
                     $results[$groupKey] = new static;
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
             $resolvedKey = $keyBy($item, $key);
489 489
 
490 490
             if (is_object($resolvedKey)) {
491
-                $resolvedKey = (string)$resolvedKey;
491
+                $resolvedKey = (string) $resolvedKey;
492 492
             }
493 493
 
494 494
             $results[$resolvedKey] = $item;
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 
596 596
         $finalItem = $collection->pop();
597 597
 
598
-        return $collection->implode($glue) . $finalGlue . $finalItem;
598
+        return $collection->implode($glue).$finalGlue.$finalItem;
599 599
     }
600 600
 
601 601
     /**
@@ -1278,11 +1278,11 @@  discard block
 block discarded – undo
1278 1278
      */
1279 1279
     public function zip($items)
1280 1280
     {
1281
-        $arrayableItems = array_map(function ($items) {
1281
+        $arrayableItems = array_map(function($items) {
1282 1282
             return $this->getArrayableItems($items);
1283 1283
         }, func_get_args());
1284 1284
 
1285
-        $params = array_merge([function () {
1285
+        $params = array_merge([function() {
1286 1286
             return new static(func_get_args());
1287 1287
         }, $this->items], $arrayableItems);
1288 1288
 
Please login to merge, or discard this patch.
src/Traits/EnumeratesValues.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -143,13 +143,13 @@  discard block
 block discarded – undo
143 143
     public function containsStrict($key, $value = null)
144 144
     {
145 145
         if (func_num_args() === 2) {
146
-            return $this->contains(function ($item) use ($key, $value) {
146
+            return $this->contains(function($item) use ($key, $value) {
147 147
                 return data_get($item, $key) === $value;
148 148
             });
149 149
         }
150 150
 
151 151
         if ($this->useAsCallable($key)) {
152
-            return ! is_null($this->first($key));
152
+            return !is_null($this->first($key));
153 153
         }
154 154
 
155 155
         foreach ($this as $item) {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     {
184 184
         (new static(func_get_args()))
185 185
             ->push($this)
186
-            ->each(function ($item) {
186
+            ->each(function($item) {
187 187
                 VarDumper::dump($item);
188 188
             });
189 189
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
      */
216 216
     public function eachSpread(callable $callback)
217 217
     {
218
-        return $this->each(function ($chunk, $key) use ($callback) {
218
+        return $this->each(function($chunk, $key) use ($callback) {
219 219
             $chunk[] = $key;
220 220
 
221 221
             return $callback(...$chunk);
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
             $callback = $this->valueRetriever($key);
237 237
 
238 238
             foreach ($this as $k => $v) {
239
-                if (! $callback($v, $k)) {
239
+                if (!$callback($v, $k)) {
240 240
                     return false;
241 241
                 }
242 242
             }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
      */
268 268
     public function isNotEmpty()
269 269
     {
270
-        return ! $this->isEmpty();
270
+        return !$this->isEmpty();
271 271
     }
272 272
 
273 273
     /**
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      */
279 279
     public function mapSpread(callable $callback)
280 280
     {
281
-        return $this->map(function ($chunk, $key) use ($callback) {
281
+        return $this->map(function($chunk, $key) use ($callback) {
282 282
             $chunk[] = $key;
283 283
 
284 284
             return $callback(...$chunk);
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
      */
320 320
     public function mapInto($class)
321 321
     {
322
-        return $this->map(function ($value, $key) use ($class) {
322
+        return $this->map(function($value, $key) use ($class) {
323 323
             return new $class($value, $key);
324 324
         });
325 325
     }
@@ -334,11 +334,11 @@  discard block
 block discarded – undo
334 334
     {
335 335
         $callback = $this->valueRetriever($callback);
336 336
 
337
-        return $this->map(function ($value) use ($callback) {
337
+        return $this->map(function($value) use ($callback) {
338 338
             return $callback($value);
339
-        })->filter(function ($value) {
340
-            return ! is_null($value);
341
-        })->reduce(function ($result, $value) {
339
+        })->filter(function($value) {
340
+            return !is_null($value);
341
+        })->reduce(function($result, $value) {
342 342
             return is_null($result) || $value < $result ? $value : $result;
343 343
         });
344 344
     }
@@ -353,9 +353,9 @@  discard block
 block discarded – undo
353 353
     {
354 354
         $callback = $this->valueRetriever($callback);
355 355
 
356
-        return $this->filter(function ($value) {
357
-            return ! is_null($value);
358
-        })->reduce(function ($result, $item) use ($callback) {
356
+        return $this->filter(function($value) {
357
+            return !is_null($value);
358
+        })->reduce(function($result, $item) use ($callback) {
359 359
             $value = $callback($item);
360 360
 
361 361
             return is_null($result) || $value > $result ? $value : $result;
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
             ? $this->identity()
417 417
             : $this->valueRetriever($callback);
418 418
 
419
-        return $this->reduce(function ($result, $item) use ($callback) {
419
+        return $this->reduce(function($result, $item) use ($callback) {
420 420
             return $result + $callback($item);
421 421
         }, 0);
422 422
     }
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
      */
432 432
     public function when($value, callable $callback = null, callable $default = null)
433 433
     {
434
-        if (! $callback) {
434
+        if (!$callback) {
435 435
             return new HigherOrderWhenProxy($this, $value);
436 436
         }
437 437
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
      */
479 479
     public function unless($value, callable $callback, callable $default = null)
480 480
     {
481
-        return $this->when(! $value, $callback, $default);
481
+        return $this->when(!$value, $callback, $default);
482 482
     }
483 483
 
484 484
     /**
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
     {
565 565
         $values = $this->getArrayableItems($values);
566 566
 
567
-        return $this->filter(function ($item) use ($key, $values, $strict) {
567
+        return $this->filter(function($item) use ($key, $values, $strict) {
568 568
             return in_array(data_get($item, $key), $values, $strict);
569 569
         });
570 570
     }
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
      */
603 603
     public function whereNotBetween($key, $values)
604 604
     {
605
-        return $this->filter(function ($item) use ($key, $values) {
605
+        return $this->filter(function($item) use ($key, $values) {
606 606
             return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
607 607
         });
608 608
     }
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
     {
620 620
         $values = $this->getArrayableItems($values);
621 621
 
622
-        return $this->reject(function ($item) use ($key, $values, $strict) {
622
+        return $this->reject(function($item) use ($key, $values, $strict) {
623 623
             return in_array(data_get($item, $key), $values, $strict);
624 624
         });
625 625
     }
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
      */
645 645
     public function whereInstanceOf($type)
646 646
     {
647
-        return $this->filter(function ($value) use ($type) {
647
+        return $this->filter(function($value) use ($type) {
648 648
             return $value instanceof $type;
649 649
         });
650 650
     }
@@ -683,9 +683,9 @@  discard block
 block discarded – undo
683 683
     {
684 684
         $useAsCallable = $this->useAsCallable($callback);
685 685
 
686
-        return $this->filter(function ($value, $key) use ($callback, $useAsCallable) {
686
+        return $this->filter(function($value, $key) use ($callback, $useAsCallable) {
687 687
             return $useAsCallable
688
-                ? ! $callback($value, $key)
688
+                ? !$callback($value, $key)
689 689
                 : $value != $callback;
690 690
         });
691 691
     }
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 
704 704
         $exists = [];
705 705
 
706
-        return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) {
706
+        return $this->reject(function($item, $key) use ($callback, $strict, &$exists) {
707 707
             if (in_array($id = $callback($item, $key), $exists, $strict)) {
708 708
                 return true;
709 709
             }
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
      */
756 756
     public function toArray()
757 757
     {
758
-        return $this->map(function ($value) {
758
+        return $this->map(function($value) {
759 759
             return $value instanceof Arrayable ? $value->toArray() : $value;
760 760
         })->all();
761 761
     }
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
      */
768 768
     public function jsonSerialize()
769 769
     {
770
-        return array_map(function ($value) {
770
+        return array_map(function($value) {
771 771
             if ($value instanceof JsonSerializable) {
772 772
                 return $value->jsonSerialize();
773 773
             } elseif ($value instanceof Jsonable) {
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
      */
834 834
     public function __get($key)
835 835
     {
836
-        if (! in_array($key, static::$proxies)) {
836
+        if (!in_array($key, static::$proxies)) {
837 837
             throw new Exception("Property [{$key}] does not exist on this collection instance.");
838 838
         }
839 839
 
@@ -887,10 +887,10 @@  discard block
 block discarded – undo
887 887
             $operator = '=';
888 888
         }
889 889
 
890
-        return function ($item) use ($key, $operator, $value) {
890
+        return function($item) use ($key, $operator, $value) {
891 891
             $retrieved = data_get($item, $key);
892 892
 
893
-            $strings = array_filter([$retrieved, $value], function ($value) {
893
+            $strings = array_filter([$retrieved, $value], function($value) {
894 894
                 return is_string($value) || (is_object($value) && method_exists($value, '__toString'));
895 895
             });
896 896
 
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
      */
923 923
     protected function useAsCallable($value)
924 924
     {
925
-        return ! is_string($value) && is_callable($value);
925
+        return !is_string($value) && is_callable($value);
926 926
     }
927 927
 
928 928
     /**
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
             return $value;
938 938
         }
939 939
 
940
-        return function ($item) use ($value) {
940
+        return function($item) use ($value) {
941 941
             return data_get($item, $value);
942 942
         };
943 943
     }
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
      */
951 951
     protected function equality($value)
952 952
     {
953
-        return function ($item) use ($value) {
953
+        return function($item) use ($value) {
954 954
             return $item === $value;
955 955
         };
956 956
     }
@@ -963,8 +963,8 @@  discard block
 block discarded – undo
963 963
      */
964 964
     protected function negate(Closure $callback)
965 965
     {
966
-        return function (...$params) use ($callback) {
967
-            return ! $callback(...$params);
966
+        return function(...$params) use ($callback) {
967
+            return !$callback(...$params);
968 968
         };
969 969
     }
970 970
 
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
      */
976 976
     protected function identity()
977 977
     {
978
-        return function ($value) {
978
+        return function($value) {
979 979
             return $value;
980 980
         };
981 981
     }
Please login to merge, or discard this patch.
src/Arr.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 
114 114
         foreach ($array as $key => $value) {
115 115
             if (is_array($value) && !empty($value)) {
116
-                $results = array_merge($results, static::dot($value, $prepend . $key . '.'));
116
+                $results = array_merge($results, static::dot($value, $prepend.$key.'.'));
117 117
             } else {
118
-                $results[$prepend . $key] = $value;
118
+                $results[$prepend.$key] = $value;
119 119
             }
120 120
         }
121 121
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     {
244 244
         $original = &$array;
245 245
 
246
-        $keys = (array)$keys;
246
+        $keys = (array) $keys;
247 247
 
248 248
         if (count($keys) === 0) {
249 249
             return;
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
      */
323 323
     public static function has($array, $keys)
324 324
     {
325
-        $keys = (array)$keys;
325
+        $keys = (array) $keys;
326 326
 
327 327
         if (!$array || $keys === []) {
328 328
             return false;
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
             return false;
361 361
         }
362 362
 
363
-        $keys = (array)$keys;
363
+        $keys = (array) $keys;
364 364
 
365 365
         if (!$array) {
366 366
             return false;
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
      */
404 404
     public static function only($array, $keys)
405 405
     {
406
-        return array_intersect_key($array, array_flip((array)$keys));
406
+        return array_intersect_key($array, array_flip((array) $keys));
407 407
     }
408 408
 
409 409
     /**
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                 $itemKey = data_get($item, $key);
433 433
 
434 434
                 if (is_object($itemKey) && method_exists($itemKey, '__toString')) {
435
-                    $itemKey = (string)$itemKey;
435
+                    $itemKey = (string) $itemKey;
436 436
                 }
437 437
 
438 438
                 $results[$itemKey] = $itemValue;
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
             return $array[array_rand($array)];
521 521
         }
522 522
 
523
-        if ((int)$number === 0) {
523
+        if ((int) $number === 0) {
524 524
             return [];
525 525
         }
526 526
 
@@ -529,11 +529,11 @@  discard block
 block discarded – undo
529 529
         $results = [];
530 530
 
531 531
         if ($preserveKeys) {
532
-            foreach ((array)$keys as $key) {
532
+            foreach ((array) $keys as $key) {
533 533
                 $results[$key] = $array[$key];
534 534
             }
535 535
         } else {
536
-            foreach ((array)$keys as $key) {
536
+            foreach ((array) $keys as $key) {
537 537
                 $results[] = $array[$key];
538 538
             }
539 539
         }
Please login to merge, or discard this patch.
src/HigherOrderCollectionProxy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function __get($key)
46 46
     {
47
-        return $this->collection->{$this->method}(function ($value) use ($key) {
47
+        return $this->collection->{$this->method}(function($value) use ($key) {
48 48
             return is_array($value) ? $value[$key] : $value->{$key};
49 49
         });
50 50
     }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function __call($method, $parameters)
60 60
     {
61
-        return $this->collection->{$this->method}(function ($value) use ($method, $parameters) {
61
+        return $this->collection->{$this->method}(function($value) use ($method, $parameters) {
62 62
             return $value->{$method}(...$parameters);
63 63
         });
64 64
     }
Please login to merge, or discard this patch.