@@ -171,7 +171,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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) |
@@ -52,10 +52,8 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Underscore function. |
| 55 | - |
|
| 56 | 55 | * This function is meant to work sort of like jQuery's "$()". It is a contextual catch-all type function. It works |
| 57 | 56 | * as a short-hand alias for invoke, collect, and with. |
| 58 | - |
|
| 59 | 57 | * @param callable|mixed $in |
| 60 | 58 | * @param mixed ... $_ |
| 61 | 59 | * |
@@ -133,10 +131,8 @@ discard block |
||
| 133 | 131 | * |
| 134 | 132 | * Accepts any kind of data and converts it to an array. If strict mode is on, only data that returns true from |
| 135 | 133 | * is_arrayable() will be converted to an array. Anything else will cause an InvalidArgumentException to be thrown. |
| 136 | - |
|
| 137 | 134 | * @param mixed $data Data to convert to array |
| 138 | 135 | * @param bool $strict Whether to use strict mode |
| 139 | - |
|
| 140 | 136 | * @return array |
| 141 | 137 | * |
| 142 | 138 | * @throws InvalidArgumentException |
@@ -491,7 +491,6 @@ |
||
| 491 | 491 | * |
| 492 | 492 | * Reduces this collection to one value by passing value, key, and the return value from the previous iteration |
| 493 | 493 | * until only one value remains. Iteration begins from the last item in the collection and moves up. |
| 494 | - |
|
| 495 | 494 | * @param callable $callback The callback function |
| 496 | 495 | * @param $initial The initial "carry" value |
| 497 | 496 | * |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | } |
| 998 | 998 | }); |
| 999 | 999 | $args = $args->prepend($this->getData()) |
| 1000 | - ->prepend(null); |
|
| 1000 | + ->prepend(null); |
|
| 1001 | 1001 | |
| 1002 | 1002 | return collect( |
| 1003 | 1003 | // array_map( |
@@ -1185,11 +1185,9 @@ discard block |
||
| 1185 | 1185 | |
| 1186 | 1186 | /** |
| 1187 | 1187 | * Get the number of times each item occurs in the collection. |
| 1188 | - |
|
| 1189 | 1188 | * This method will return a NumericCollection where keys are the |
| 1190 | 1189 | * values and values are the number of times that value occurs in |
| 1191 | 1190 | * the original collection. |
| 1192 | - |
|
| 1193 | 1191 | * @return CollectionInterface |
| 1194 | 1192 | */ |
| 1195 | 1193 | public function counts() |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | */ |
| 348 | 348 | public function contains($value, $index = null) |
| 349 | 349 | { |
| 350 | - return (bool) $this->first(function ($val, $key) use ($value, $index) { |
|
| 350 | + return (bool) $this->first(function($val, $key) use ($value, $index) { |
|
| 351 | 351 | if (is_callable($value)) { |
| 352 | 352 | $found = $value($val, $key); |
| 353 | 353 | } else { |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | public function pairs() |
| 627 | 627 | { |
| 628 | 628 | return collect(array_map( |
| 629 | - function ($key, $val) { |
|
| 629 | + function($key, $val) { |
|
| 630 | 630 | return [$key, $val]; |
| 631 | 631 | }, |
| 632 | 632 | array_keys($this->getData()), |
@@ -645,11 +645,11 @@ discard block |
||
| 645 | 645 | public function duplicates() |
| 646 | 646 | { |
| 647 | 647 | $dups = []; |
| 648 | - $this->walk(function ($val, $key) use (&$dups) { |
|
| 648 | + $this->walk(function($val, $key) use (&$dups) { |
|
| 649 | 649 | $dups[$val][] = $key; |
| 650 | 650 | }); |
| 651 | 651 | |
| 652 | - return collect($dups)->filter(function ($val) { |
|
| 652 | + return collect($dups)->filter(function($val) { |
|
| 653 | 653 | return count($val) > 1; |
| 654 | 654 | }); |
| 655 | 655 | } |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | public function split($num) |
| 937 | 937 | { |
| 938 | 938 | $count = $this->count(); |
| 939 | - $size = (int)($count / $num); |
|
| 939 | + $size = (int) ($count / $num); |
|
| 940 | 940 | $mod = $count % $num; |
| 941 | 941 | return collect($this->foldRight(function($chunks, $val, $key, $iter) use ($num, $size, $mod) { |
| 942 | 942 | $chunk_count = count($chunks); |
@@ -110,10 +110,8 @@ |
||
| 110 | 110 | * |
| 111 | 111 | * Accepts any kind of data and converts it to an array. If strict mode is on, only data that returns true from |
| 112 | 112 | * is_arrayable() will be converted to an array. Anything else will cause an InvalidArgumentException to be thrown. |
| 113 | - |
|
| 114 | 113 | * @param mixed $data Data to convert to array |
| 115 | 114 | * @param bool $strict Whether to use strict mode |
| 116 | - |
|
| 117 | 115 | * @return array |
| 118 | 116 | * |
| 119 | 117 | * @throws InvalidArgumentException |