Completed
Branch master (874053)
by Antonio Carlos
07:23
created
src/package/Coollection.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     /**
287 287
      * Get a property by name.
288 288
      *
289
-     * @param $key
289
+     * @param string $key
290 290
      * @return string|static
291 291
      */
292 292
     private function getByPropertyName($key)
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     /**
306 306
      * Execute a closure via Laravel's Collection
307 307
      *
308
-     * @param $closure
308
+     * @param Closure $closure
309 309
      * @param null $method
310 310
      * @return mixed
311 311
      */
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 
455 455
     /**
456 456
      * @param $originalCallback
457
-     * @return callable
457
+     * @return Closure
458 458
      */
459 459
     public function coollectizeCallback(callable $originalCallback = null)
460 460
     {
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 
468 468
     /**
469 469
      * @param $originalCallback
470
-     * @return callable
470
+     * @return Closure
471 471
      */
472 472
     public function coollectizeCallbackForReduce(callable $originalCallback)
473 473
     {
Please login to merge, or discard this patch.
Unused Use Statements   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,20 +2,19 @@
 block discarded – undo
2 2
 
3 3
 namespace PragmaRX\Coollection\Package;
4 4
 
5
+use ArrayAccess;
5 6
 use Closure;
6 7
 use Countable;
7 8
 use Exception;
8
-use ArrayAccess;
9
-use JsonSerializable;
10
-use IteratorAggregate;
11
-use IlluminateAgnostic\Str\Support\Str;
12 9
 use IlluminateAgnostic\Arr\Support\Arr;
13
-use IlluminateAgnostic\Collection\Support\Collection;
14
-use IlluminateAgnostic\Collection\Support\Traits\Macroable;
15
-use IlluminateAgnostic\Collection\Contracts\Support\Jsonable;
16 10
 use IlluminateAgnostic\Collection\Contracts\Support\Arrayable;
17
-use IlluminateAgnostic\Collection\Support\HigherOrderCollectionProxy;
11
+use IlluminateAgnostic\Collection\Contracts\Support\Jsonable;
18 12
 use IlluminateAgnostic\Collection\Support\Collection as TightencoCollect;
13
+use IlluminateAgnostic\Collection\Support\HigherOrderCollectionProxy;
14
+use IlluminateAgnostic\Collection\Support\Traits\Macroable;
15
+use IlluminateAgnostic\Str\Support\Str;
16
+use IteratorAggregate;
17
+use JsonSerializable;
19 18
 
20 19
 class Coollection implements ArrayAccess, Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable
21 20
 {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function call($name, $arguments = [])
105 105
     {
106
-        return $this->runViaLaravelCollection(function ($collection) use ($name, $arguments) {
106
+        return $this->runViaLaravelCollection(function($collection) use ($name, $arguments) {
107 107
             return call_user_func_array(
108 108
                 [$collection, $name],
109 109
                 $this->coollectizeCallbacks($this->__toArray($arguments), $name)
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
     {
122 122
         $value = is_null($value) ? $this->items : $value;
123 123
 
124
-        if (! $this->isArrayable($value)) {
124
+        if (!$this->isArrayable($value)) {
125 125
             return $value;
126 126
         }
127 127
 
128
-        $result = array_map(function ($value) {
128
+        $result = array_map(function($value) {
129 129
             if ($this->isArrayable($value)) {
130 130
                 return new static($value);
131 131
             }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     public function toArray()
145 145
     {
146
-        return array_map(function ($value) {
146
+        return array_map(function($value) {
147 147
             return $value instanceof Arrayable ? $value->toArray() : $value;
148 148
         }, $this->items);
149 149
     }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             return null;
171 171
         }
172 172
 
173
-        return $this->runViaLaravelCollection(function ($collection) use ($key) {
173
+        return $this->runViaLaravelCollection(function($collection) use ($key) {
174 174
             return new HigherOrderCollectionProxy($collection, $key);
175 175
         });
176 176
     }
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
     {
186 186
         $value = is_null($value) ? $this->items : $value;
187 187
 
188
-        if (! $this->isArrayable($value)) {
188
+        if (!$this->isArrayable($value)) {
189 189
             return $value;
190 190
         }
191 191
 
192
-        $result = array_map(function ($value) {
192
+        $result = array_map(function($value) {
193 193
             if ($this->isArrayable($value)) {
194 194
                 return $this->__toArray($value);
195 195
             }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
             return $key;
260 260
         }
261 261
 
262
-        $value = $this->keys()->mapWithKeys(function ($item) {
262
+        $value = $this->keys()->mapWithKeys(function($item) {
263 263
             return [$this->snake($item) => $item];
264 264
         })->get(lower($key));
265 265
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
         $result = $closure($collection);
317 317
 
318
-        if (! $this->methodMustReturnArray($method)) {
318
+        if (!$this->methodMustReturnArray($method)) {
319 319
             $result = $this->coollectizeItems($result);
320 320
         }
321 321
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
      */
400 400
     public function offsetGet($key)
401 401
     {
402
-        if (! isset($this->items[$key])) {
402
+        if (!isset($this->items[$key])) {
403 403
             return null;
404 404
         }
405 405
 
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
      */
459 459
     public function coollectizeCallback(callable $originalCallback = null)
460 460
     {
461
-        return function ($value = null, $key = null) use ($originalCallback) {
461
+        return function($value = null, $key = null) use ($originalCallback) {
462 462
             return $originalCallback(
463 463
                 $this->__wrap($value), $key
464 464
             );
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
      */
472 472
     public function coollectizeCallbackForReduce(callable $originalCallback)
473 473
     {
474
-        return function ($carry, $item) use ($originalCallback) {
474
+        return function($carry, $item) use ($originalCallback) {
475 475
             return $originalCallback(
476 476
                 $carry,
477 477
                 $this->__wrap($item)
Please login to merge, or discard this patch.
src/package/Support/Traits/Macroable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
      */
71 71
     public static function __callStatic($method, $parameters)
72 72
     {
73
-        if (! static::hasMacro($method)) {
73
+        if (!static::hasMacro($method)) {
74 74
             throw new BadMethodCallException("Method {$method} does not exist.");
75 75
         }
76 76
 
Please login to merge, or discard this patch.
src/package/Support/helpers.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use IlluminateAgnostic\Str\Support\Str;
4 4
 use PragmaRX\Coollection\Package\Coollection;
5 5
 
6
-if (! function_exists('coollect')) {
6
+if (!function_exists('coollect')) {
7 7
     /**
8 8
      * Create a collection from the given value.
9 9
      *
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     }
21 21
 }
22 22
 
23
-if (! function_exists('snake')) {
23
+if (!function_exists('snake')) {
24 24
     /**
25 25
      * Convert a string to snake case.
26 26
      *
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     }
35 35
 }
36 36
 
37
-if (! function_exists('lower')) {
37
+if (!function_exists('lower')) {
38 38
     /**
39 39
      * Convert the given string to lower-case.
40 40
      *
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     }
48 48
 }
49 49
 
50
-if (! function_exists('upper')) {
50
+if (!function_exists('upper')) {
51 51
     /**
52 52
      * Convert the given string to lower-case.
53 53
      *
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 /**
64 64
  * @codeCoverageIgnore
65 65
  */
66
-if (! function_exists('dump')) {
66
+if (!function_exists('dump')) {
67 67
     function dump(...$args)
68 68
     {
69 69
         foreach ($args as $value) {
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 /**
76 76
  * @codeCoverageIgnore
77 77
  */
78
-if (! function_exists('dd')) {
78
+if (!function_exists('dd')) {
79 79
     function dd(...$args)
80 80
     {
81 81
         dump(...$args);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     }
85 85
 }
86 86
 
87
-if (! function_exists('starts_with')) {
87
+if (!function_exists('starts_with')) {
88 88
     /**
89 89
      * Determine if a given string starts with a given substring.
90 90
      *
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     }
99 99
 }
100 100
 
101
-if (! function_exists('array_sort_by_keys_recursive')) {
101
+if (!function_exists('array_sort_by_keys_recursive')) {
102 102
     /**
103 103
      * Determine if a given string starts with a given substring.
104 104
      *
Please login to merge, or discard this patch.