| @@ 5373-5384 (lines=12) @@ | ||
| 5370 | * @psalm-return static<TKey,T> |
|
| 5371 | * @psalm-mutation-free |
|
| 5372 | */ |
|
| 5373 | public function removeFirst(): self |
|
| 5374 | { |
|
| 5375 | $tmpArray = $this->toArray(); |
|
| 5376 | ||
| 5377 | \array_shift($tmpArray); |
|
| 5378 | ||
| 5379 | return static::create( |
|
| 5380 | $tmpArray, |
|
| 5381 | $this->iteratorClass, |
|
| 5382 | false |
|
| 5383 | ); |
|
| 5384 | } |
|
| 5385 | ||
| 5386 | /** |
|
| 5387 | * Remove the last value from the current array. |
|
| @@ 5399-5410 (lines=12) @@ | ||
| 5396 | * @psalm-return static<TKey,T> |
|
| 5397 | * @psalm-mutation-free |
|
| 5398 | */ |
|
| 5399 | public function removeLast(): self |
|
| 5400 | { |
|
| 5401 | $tmpArray = $this->toArray(); |
|
| 5402 | ||
| 5403 | \array_pop($tmpArray); |
|
| 5404 | ||
| 5405 | return static::create( |
|
| 5406 | $tmpArray, |
|
| 5407 | $this->iteratorClass, |
|
| 5408 | false |
|
| 5409 | ); |
|
| 5410 | } |
|
| 5411 | ||
| 5412 | /** |
|
| 5413 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 5683-5692 (lines=10) @@ | ||
| 5680 | * @psalm-return static<TKey,T> |
|
| 5681 | * @psalm-mutation-free |
|
| 5682 | */ |
|
| 5683 | public function rest(int $from = 1): self |
|
| 5684 | { |
|
| 5685 | $tmpArray = $this->toArray(); |
|
| 5686 | ||
| 5687 | return static::create( |
|
| 5688 | \array_splice($tmpArray, $from), |
|
| 5689 | $this->iteratorClass, |
|
| 5690 | false |
|
| 5691 | ); |
|
| 5692 | } |
|
| 5693 | ||
| 5694 | /** |
|
| 5695 | * Return the array in the reverse order. |
|