| @@ 5489-5500 (lines=12) @@ | ||
| 5486 | * @phpstan-return static<TKey,T> |
|
| 5487 | * @psalm-mutation-free |
|
| 5488 | */ |
|
| 5489 | public function removeFirst(): self |
|
| 5490 | { |
|
| 5491 | $tmpArray = $this->toArray(); |
|
| 5492 | ||
| 5493 | \array_shift($tmpArray); |
|
| 5494 | ||
| 5495 | return static::create( |
|
| 5496 | $tmpArray, |
|
| 5497 | $this->iteratorClass, |
|
| 5498 | false |
|
| 5499 | ); |
|
| 5500 | } |
|
| 5501 | ||
| 5502 | /** |
|
| 5503 | * Remove the last value from the current array. |
|
| @@ 5515-5526 (lines=12) @@ | ||
| 5512 | * @phpstan-return static<TKey,T> |
|
| 5513 | * @psalm-mutation-free |
|
| 5514 | */ |
|
| 5515 | public function removeLast(): self |
|
| 5516 | { |
|
| 5517 | $tmpArray = $this->toArray(); |
|
| 5518 | ||
| 5519 | \array_pop($tmpArray); |
|
| 5520 | ||
| 5521 | return static::create( |
|
| 5522 | $tmpArray, |
|
| 5523 | $this->iteratorClass, |
|
| 5524 | false |
|
| 5525 | ); |
|
| 5526 | } |
|
| 5527 | ||
| 5528 | /** |
|
| 5529 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 5814-5823 (lines=10) @@ | ||
| 5811 | * @phpstan-return static<TKey,T> |
|
| 5812 | * @psalm-mutation-free |
|
| 5813 | */ |
|
| 5814 | public function rest(int $from = 1): self |
|
| 5815 | { |
|
| 5816 | $tmpArray = $this->toArray(); |
|
| 5817 | ||
| 5818 | return static::create( |
|
| 5819 | \array_splice($tmpArray, $from), |
|
| 5820 | $this->iteratorClass, |
|
| 5821 | false |
|
| 5822 | ); |
|
| 5823 | } |
|
| 5824 | ||
| 5825 | /** |
|
| 5826 | * Return the array in the reverse order. |
|