| @@ 4492-4503 (lines=12) @@ | ||
| 4489 | * @psalm-return static<TKey,T> |
|
| 4490 | * @psalm-mutation-free |
|
| 4491 | */ |
|
| 4492 | public function removeFirst(): self |
|
| 4493 | { |
|
| 4494 | $tmpArray = $this->toArray(); |
|
| 4495 | ||
| 4496 | \array_shift($tmpArray); |
|
| 4497 | ||
| 4498 | return static::create( |
|
| 4499 | $tmpArray, |
|
| 4500 | $this->iteratorClass, |
|
| 4501 | false |
|
| 4502 | ); |
|
| 4503 | } |
|
| 4504 | ||
| 4505 | /** |
|
| 4506 | * Remove the last value from the current array. |
|
| @@ 4514-4525 (lines=12) @@ | ||
| 4511 | * @psalm-return static<TKey,T> |
|
| 4512 | * @psalm-mutation-free |
|
| 4513 | */ |
|
| 4514 | public function removeLast(): self |
|
| 4515 | { |
|
| 4516 | $tmpArray = $this->toArray(); |
|
| 4517 | ||
| 4518 | \array_pop($tmpArray); |
|
| 4519 | ||
| 4520 | return static::create( |
|
| 4521 | $tmpArray, |
|
| 4522 | $this->iteratorClass, |
|
| 4523 | false |
|
| 4524 | ); |
|
| 4525 | } |
|
| 4526 | ||
| 4527 | /** |
|
| 4528 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 4741-4750 (lines=10) @@ | ||
| 4738 | * @psalm-return static<TKey,T> |
|
| 4739 | * @psalm-mutation-free |
|
| 4740 | */ |
|
| 4741 | public function rest(int $from = 1): self |
|
| 4742 | { |
|
| 4743 | $tmpArray = $this->toArray(); |
|
| 4744 | ||
| 4745 | return static::create( |
|
| 4746 | \array_splice($tmpArray, $from), |
|
| 4747 | $this->iteratorClass, |
|
| 4748 | false |
|
| 4749 | ); |
|
| 4750 | } |
|
| 4751 | ||
| 4752 | /** |
|
| 4753 | * Return the array in the reverse order. |
|