@@ -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, |
@@ -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; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * You may optionally pass in a callback which will determine if each of the items within the collection are empty. |
| 135 | 135 | * If all items in the collection are empty according to this callback, this method will return true. |
| 136 | 136 | * @param callable $callback The callback |
| 137 | - * @return bool |
|
| 137 | + * @return boolean|null |
|
| 138 | 138 | */ |
| 139 | 139 | public function isEmpty(callable $callback = null) |
| 140 | 140 | { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * If callback is provided, this method will return true if all items in collection cause callback to return true. |
| 158 | 158 | * Otherwise, it will return true if all items in the collection have a truthy value. |
| 159 | 159 | * @param callable|null $callback The callback |
| 160 | - * @return bool |
|
| 160 | + * @return boolean|null |
|
| 161 | 161 | */ |
| 162 | 162 | public function every(callable $callback = null) |
| 163 | 163 | { |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * Does every item return false? |
| 169 | 169 | * This method is the exact opposite of "all". |
| 170 | 170 | * @param callable|null $callback The callback |
| 171 | - * @return bool |
|
| 171 | + * @return boolean|null |
|
| 172 | 172 | */ |
| 173 | 173 | public function none(callable $callback = null) |
| 174 | 174 | { |
@@ -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; |
@@ -62,7 +62,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -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; |