@@ 5342-5353 (lines=12) @@ | ||
5339 | * @psalm-return static<TKey,T> |
|
5340 | * @psalm-mutation-free |
|
5341 | */ |
|
5342 | public function removeFirst(): self |
|
5343 | { |
|
5344 | $tmpArray = $this->toArray(); |
|
5345 | ||
5346 | \array_shift($tmpArray); |
|
5347 | ||
5348 | return static::create( |
|
5349 | $tmpArray, |
|
5350 | $this->iteratorClass, |
|
5351 | false |
|
5352 | ); |
|
5353 | } |
|
5354 | ||
5355 | /** |
|
5356 | * Remove the last value from the current array. |
|
@@ 5368-5379 (lines=12) @@ | ||
5365 | * @psalm-return static<TKey,T> |
|
5366 | * @psalm-mutation-free |
|
5367 | */ |
|
5368 | public function removeLast(): self |
|
5369 | { |
|
5370 | $tmpArray = $this->toArray(); |
|
5371 | ||
5372 | \array_pop($tmpArray); |
|
5373 | ||
5374 | return static::create( |
|
5375 | $tmpArray, |
|
5376 | $this->iteratorClass, |
|
5377 | false |
|
5378 | ); |
|
5379 | } |
|
5380 | ||
5381 | /** |
|
5382 | * Removes a particular value from an array (numeric or associative). |
|
@@ 5652-5661 (lines=10) @@ | ||
5649 | * @psalm-return static<TKey,T> |
|
5650 | * @psalm-mutation-free |
|
5651 | */ |
|
5652 | public function rest(int $from = 1): self |
|
5653 | { |
|
5654 | $tmpArray = $this->toArray(); |
|
5655 | ||
5656 | return static::create( |
|
5657 | \array_splice($tmpArray, $from), |
|
5658 | $this->iteratorClass, |
|
5659 | false |
|
5660 | ); |
|
5661 | } |
|
5662 | ||
5663 | /** |
|
5664 | * Return the array in the reverse order. |