@@ -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 | * |
@@ -14,13 +14,12 @@ |
||
| 14 | 14 | use InvalidArgumentException; |
| 15 | 15 | use Iterator; |
| 16 | 16 | use Noz\Contracts\Arrayable; |
| 17 | -use Noz\Contracts\Invokable; |
|
| 18 | 17 | use Noz\Contracts\CollectionInterface; |
| 18 | +use Noz\Contracts\Invokable; |
|
| 19 | +use Noz\Traits\IsArrayable; |
|
| 19 | 20 | use OutOfBoundsException; |
| 20 | 21 | use Traversable; |
| 21 | 22 | |
| 22 | -use Noz\Traits\IsArrayable; |
|
| 23 | - |
|
| 24 | 23 | use function |
| 25 | 24 | Noz\is_traversable, |
| 26 | 25 | Noz\typeof, |
@@ -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() |
@@ -9,18 +9,11 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | namespace Noz\Collection; |
| 11 | 11 | |
| 12 | -use BadMethodCallException; |
|
| 13 | - |
|
| 14 | 12 | use Countable; |
| 15 | -use Noz\Contracts\Structure\Dictable; |
|
| 16 | -use Traversable; |
|
| 17 | -use SplFixedArray; |
|
| 18 | - |
|
| 19 | -use Noz\Contracts\Structure\Sequenceable; |
|
| 20 | -use Noz\Contracts\Immutable; |
|
| 21 | 13 | use Noz\Contracts\Arrayable; |
| 14 | +use Noz\Contracts\Immutable; |
|
| 22 | 15 | use Noz\Contracts\Invokable; |
| 23 | - |
|
| 16 | +use Noz\Contracts\Structure\Dictable; |
|
| 24 | 17 | use Noz\Traits\IsImmutable; |
| 25 | 18 | |
| 26 | 19 | use function Noz\to_array; |
@@ -9,19 +9,13 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | namespace Noz\Collection; |
| 11 | 11 | |
| 12 | -use BadMethodCallException; |
|
| 13 | - |
|
| 14 | 12 | use Countable; |
| 15 | -use Noz\Contracts\Structure\Listable; |
|
| 16 | -use Traversable; |
|
| 17 | -use SplDoublyLinkedList; |
|
| 18 | - |
|
| 19 | -use Noz\Contracts\Structure\Sequenceable; |
|
| 20 | -use Noz\Contracts\Immutable; |
|
| 21 | 13 | use Noz\Contracts\Arrayable; |
| 14 | +use Noz\Contracts\Immutable; |
|
| 22 | 15 | use Noz\Contracts\Invokable; |
| 23 | - |
|
| 16 | +use Noz\Contracts\Structure\Listable; |
|
| 24 | 17 | use Noz\Traits\IsImmutable; |
| 18 | +use SplDoublyLinkedList; |
|
| 25 | 19 | |
| 26 | 20 | use function Noz\to_array; |
| 27 | 21 | use function Noz\is_traversable; |
@@ -9,18 +9,11 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | namespace Noz\Collection; |
| 11 | 11 | |
| 12 | -use BadMethodCallException; |
|
| 13 | - |
|
| 14 | 12 | use Countable; |
| 15 | -use Noz\Contracts\Structure\Listable; |
|
| 16 | -use Traversable; |
|
| 17 | -use SplFixedArray; |
|
| 18 | - |
|
| 19 | -use Noz\Contracts\Structure\Sequenceable; |
|
| 20 | -use Noz\Contracts\Immutable; |
|
| 21 | 13 | use Noz\Contracts\Arrayable; |
| 14 | +use Noz\Contracts\Immutable; |
|
| 22 | 15 | use Noz\Contracts\Invokable; |
| 23 | - |
|
| 16 | +use Noz\Contracts\Structure\Listable; |
|
| 24 | 17 | use Noz\Traits\IsImmutable; |
| 25 | 18 | |
| 26 | 19 | use function Noz\to_array; |
@@ -10,17 +10,14 @@ |
||
| 10 | 10 | namespace Noz\Collection; |
| 11 | 11 | |
| 12 | 12 | use BadMethodCallException; |
| 13 | - |
|
| 14 | 13 | use Countable; |
| 15 | -use Traversable; |
|
| 16 | -use SplFixedArray; |
|
| 17 | - |
|
| 18 | -use Noz\Contracts\Structure\Sequenceable; |
|
| 19 | -use Noz\Contracts\Immutable; |
|
| 20 | 14 | use Noz\Contracts\Arrayable; |
| 15 | +use Noz\Contracts\Immutable; |
|
| 21 | 16 | use Noz\Contracts\Invokable; |
| 22 | - |
|
| 17 | +use Noz\Contracts\Structure\Sequenceable; |
|
| 23 | 18 | use Noz\Traits\IsImmutable; |
| 19 | +use SplFixedArray; |
|
| 20 | +use Traversable; |
|
| 24 | 21 | |
| 25 | 22 | use function Noz\to_array; |
| 26 | 23 | use function Noz\is_traversable; |
@@ -9,17 +9,11 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | namespace Noz\Collection; |
| 11 | 11 | |
| 12 | -use BadMethodCallException; |
|
| 13 | - |
|
| 14 | 12 | use Countable; |
| 15 | -use Traversable; |
|
| 16 | -use SplFixedArray; |
|
| 17 | - |
|
| 18 | -use Noz\Contracts\Structure\Settable; |
|
| 19 | -use Noz\Contracts\Immutable; |
|
| 20 | 13 | use Noz\Contracts\Arrayable; |
| 14 | +use Noz\Contracts\Immutable; |
|
| 21 | 15 | use Noz\Contracts\Invokable; |
| 22 | - |
|
| 16 | +use Noz\Contracts\Structure\Settable; |
|
| 23 | 17 | use Noz\Traits\IsImmutable; |
| 24 | 18 | |
| 25 | 19 | use function Noz\to_array; |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | namespace Noz; |
| 11 | 11 | |
| 12 | -use Closure; |
|
| 13 | 12 | use InvalidArgumentException; |
| 14 | 13 | use Iterator; |
| 15 | 14 | use Noz\Collection\Collection; |
@@ -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 |
@@ -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 |