Completed
Pull Request — master (#76)
by Luke
02:26
created
src/functions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 {
172 172
     $type = gettype($data);
173 173
     if ($meta) {
174
-        switch($type) {
174
+        switch ($type) {
175 175
             case 'object':
176 176
                 $class = get_class($data);
177 177
                 return "{$type} <{$class}>";
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                 return "{$type} <{$restype}>";
181 181
         }
182 182
     } else {
183
-        switch($type) {
183
+        switch ($type) {
184 184
             case 'object':
185 185
                 return get_class($data);
186 186
             case 'resource':
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     } else {
271 271
         echo $label . "\n" . implode(
272 272
                 array_map(
273
-                    function () {
273
+                    function() {
274 274
                         return '-';
275 275
                     },
276 276
                     str_split($label)
Please login to merge, or discard this patch.
src/Contracts/CollectionInterface.php 1 patch
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @param string|int $index Set value at this index
63 63
      * @param mixed      $value Set this value at index
64 64
      *
65
-     * @return mixed
65
+     * @return CollectionInterface
66 66
      */
67 67
     public function set($index, $value);
68 68
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * @param string|int $index Delete item at this index
75 75
      *
76
-     * @return mixed
76
+     * @return CollectionInterface
77 77
      */
78 78
     public function delete($index);
79 79
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * @param string|int $index Add value at this index
109 109
      * @param mixed      $value Add this value at index
110 110
      *
111
-     * @return mixed
111
+     * @return CollectionInterface
112 112
      */
113 113
     public function add($index, $value);
114 114
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      * @param int  $nth    The number of items between cycles
165 165
      * @param null $offset An optional offset to begin from
166 166
      *
167
-     * @return mixed
167
+     * @return CollectionInterface
168 168
      */
169 169
     public function nth($nth, $offset = null);
170 170
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      *
229 229
      * @param int $num Number of items to return
230 230
      *
231
-     * @return mixed|CollectionInterface
231
+     * @return CollectionInterface
232 232
      */
233 233
     public function random($num);
234 234
 
Please login to merge, or discard this patch.
src/Traits/IsContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public function contains($value, $index = null)
32 32
     {
33
-        return (bool) $this->fold(function ($carry, $val, $key) use ($value, $index) {
33
+        return (bool) $this->fold(function($carry, $val, $key) use ($value, $index) {
34 34
             if ($carry) {
35 35
                 return $carry;
36 36
             }
Please login to merge, or discard this patch.
src/Immutable/LList.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
      *
206 206
      * @param callable|null $funk The callback
207 207
      *
208
-     * @return bool
208
+     * @return boolean|null
209 209
      */
210 210
     public function every(callable $funk = null)
211 211
     {
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
      *
225 225
      * @param callable|null $callback The callback
226 226
      *
227
-     * @return bool
227
+     * @return boolean|null
228 228
      */
229 229
     public function none(callable $callback = null)
230 230
     {
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
     /**
284 284
      * @param callable|null $folder
285
-     * @param null          $initial
285
+     * @param boolean          $initial
286 286
      *
287 287
      * @return null
288 288
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
         } else {
76 76
             $dll = new SplDoublyLinkedList($data);
77 77
             $dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_KEEP);
78
-            foreach($data as $key => $val) {
78
+            foreach ($data as $key => $val) {
79 79
                 $dll->push($val);
80 80
             }
81 81
         }
Please login to merge, or discard this patch.
src/Immutable/Sequence.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     /**
165 165
      * Return the key of the current element.
166 166
      *
167
-     * @return mixed|null
167
+     * @return integer
168 168
      */
169 169
     public function key()
170 170
     {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
      * Fold (reduce) sequence into a single value.
377 377
      *
378 378
      * @param callable $funk    A callback function
379
-     * @param mixed    $initial Initial value for accumulator
379
+     * @param boolean    $initial Initial value for accumulator
380 380
      *
381 381
      * @return mixed
382 382
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             $count = $this->count();
104 104
             if (count($args)) {
105 105
                 // if there are more args...
106
-                $length =  array_shift($args);
106
+                $length = array_shift($args);
107 107
             }
108 108
             if (Str::contains($offset, static::SLICE_DELIM)) {
109 109
                 list($start, $length) = get_range_start_end($offset, $count);
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
     public function isEmpty(callable $funk = null)
414 414
     {
415 415
         if (!is_null($funk)) {
416
-            return $this->fold(function ($carry, $val) use ($funk) {
416
+            return $this->fold(function($carry, $val) use ($funk) {
417 417
                 return $carry && $funk($val);
418 418
             }, true);
419 419
         }
Please login to merge, or discard this patch.
src/Immutable/Collection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
     public function pairs()
590 590
     {
591 591
         return collect(array_map(
592
-            function ($key, $val) {
592
+            function($key, $val) {
593 593
                 return [$key, $val];
594 594
             },
595 595
             array_keys($this->getData()),
@@ -608,11 +608,11 @@  discard block
 block discarded – undo
608 608
     public function duplicates()
609 609
     {
610 610
         $dups = [];
611
-        $this->walk(function ($val, $key) use (&$dups) {
611
+        $this->walk(function($val, $key) use (&$dups) {
612 612
             $dups[$val][] = $key;
613 613
         });
614 614
 
615
-        return collect($dups)->filter(function ($val) {
615
+        return collect($dups)->filter(function($val) {
616 616
             return count($val) > 1;
617 617
         });
618 618
     }
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
     public function split($num)
900 900
     {
901 901
         $count = $this->count();
902
-        $size = (int)($count / $num);
902
+        $size = (int) ($count / $num);
903 903
         $mod = $count % $num;
904 904
         return collect($this->fold(function($chunks, $val, $key, $iter) use ($num, $size, $mod) {
905 905
             $chunk_count = count($chunks);
Please login to merge, or discard this patch.
src/Collection.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         } else {
421 421
             $iter     = 0;
422 422
             $filtered = [];
423
-            foreach($this as $key => $val) {
423
+            foreach ($this as $key => $val) {
424 424
                 if ($predicate($val, $key, $iter++)) {
425 425
                     $filtered[$key] = $val;
426 426
                 }
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                 return $this->getOffset(0);
475 475
             }
476 476
         } else {
477
-            foreach($this as $index => $value) {
477
+            foreach ($this as $index => $value) {
478 478
                 if ($predicate($value, $index)) {
479 479
                     return $value;
480 480
                 }
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     public function pairs()
606 606
     {
607 607
         return static::factory(array_map(
608
-            function ($key, $val) {
608
+            function($key, $val) {
609 609
                 return [$key, $val];
610 610
             },
611 611
             array_keys($this->getData()),
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
         $orig = $this->getData();
743 743
         $cmpr = to_array($data);
744 744
 
745
-        if (is_null ($equals)) {
745
+        if (is_null($equals)) {
746 746
             $equals = function($a, $b) {
747 747
                 return $a == $b;
748 748
             };
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
     public function split($num)
892 892
     {
893 893
         $count = $this->count();
894
-        $size = (int)($count / $num);
894
+        $size = (int) ($count / $num);
895 895
         $mod = $count % $num;
896 896
         return static::factory($this->fold(function($chunks, $val, $key, $iter) use ($num, $size, $mod) {
897 897
             $chunk_count = count($chunks);
Please login to merge, or discard this patch.