@@ -9,19 +9,16 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | namespace Noz\Collection; |
| 11 | 11 | |
| 12 | -use InvalidArgumentException; |
|
| 13 | - |
|
| 14 | 12 | use Countable; |
| 15 | -use Traversable; |
|
| 16 | -use SplDoublyLinkedList; |
|
| 17 | - |
|
| 18 | -use Noz\Contracts\Structure\Listable; |
|
| 19 | -use Noz\Contracts\Immutable; |
|
| 13 | +use InvalidArgumentException; |
|
| 20 | 14 | use Noz\Contracts\Arrayable; |
| 15 | +use Noz\Contracts\Immutable; |
|
| 21 | 16 | use Noz\Contracts\Invokable; |
| 22 | - |
|
| 17 | +use Noz\Contracts\Structure\Listable; |
|
| 23 | 18 | use Noz\Traits\IsArrayable; |
| 24 | 19 | use Noz\Traits\IsImmutable; |
| 20 | +use SplDoublyLinkedList; |
|
| 21 | +use Traversable; |
|
| 25 | 22 | |
| 26 | 23 | use function |
| 27 | 24 | Noz\to_array, |
@@ -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\Listable; |
|
| 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\Listable; |
|
| 23 | 17 | use Noz\Traits\IsImmutable; |
| 24 | 18 | |
| 25 | 19 | use function Noz\to_array; |
@@ -83,16 +83,12 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Invoke sequence. |
| 86 | - |
|
| 87 | 86 | * A sequence is invokable as if it were a function. This allows some pretty useful functionality such as negative |
| 88 | 87 | * indexing, sub-sequence selection, etc. Basically, any way you invoke a sequence, you're going to get back either |
| 89 | 88 | * a single value from the sequence or a subset of it. |
| 90 | - |
|
| 91 | 89 | * @internal param mixed $funk Either a numerical offset (positive or negative), a range string (start:end), or a |
| 92 | 90 | * callback to be used as a filter. |
| 93 | - |
|
| 94 | 91 | * @return mixed |
| 95 | - |
|
| 96 | 92 | * @todo Put all the slice logic into a helper function or several |
| 97 | 93 | */ |
| 98 | 94 | public function __invoke() |
@@ -360,12 +356,12 @@ discard block |
||
| 360 | 356 | * |
| 361 | 357 | * @return Sequence |
| 362 | 358 | */ |
| 363 | - public function prepend($item) |
|
| 364 | - { |
|
| 365 | - $arr = $this->getData(); |
|
| 366 | - array_unshift($arr, $item); |
|
| 367 | - return new static($arr); |
|
| 368 | - } |
|
| 359 | + public function prepend($item) |
|
| 360 | + { |
|
| 361 | + $arr = $this->getData(); |
|
| 362 | + array_unshift($arr, $item); |
|
| 363 | + return new static($arr); |
|
| 364 | + } |
|
| 369 | 365 | |
| 370 | 366 | /** |
| 371 | 367 | * Append item to collection. |