| @@ 4672-4683 (lines=12) @@ | ||
| 4669 | * @psalm-return static<TKey,T> |
|
| 4670 | * @psalm-mutation-free |
|
| 4671 | */ |
|
| 4672 | public function removeFirst(): self |
|
| 4673 | { |
|
| 4674 | $tmpArray = $this->toArray(); |
|
| 4675 | ||
| 4676 | \array_shift($tmpArray); |
|
| 4677 | ||
| 4678 | return static::create( |
|
| 4679 | $tmpArray, |
|
| 4680 | $this->iteratorClass, |
|
| 4681 | false |
|
| 4682 | ); |
|
| 4683 | } |
|
| 4684 | ||
| 4685 | /** |
|
| 4686 | * Remove the last value from the current array. |
|
| @@ 4694-4705 (lines=12) @@ | ||
| 4691 | * @psalm-return static<TKey,T> |
|
| 4692 | * @psalm-mutation-free |
|
| 4693 | */ |
|
| 4694 | public function removeLast(): self |
|
| 4695 | { |
|
| 4696 | $tmpArray = $this->toArray(); |
|
| 4697 | ||
| 4698 | \array_pop($tmpArray); |
|
| 4699 | ||
| 4700 | return static::create( |
|
| 4701 | $tmpArray, |
|
| 4702 | $this->iteratorClass, |
|
| 4703 | false |
|
| 4704 | ); |
|
| 4705 | } |
|
| 4706 | ||
| 4707 | /** |
|
| 4708 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 4921-4930 (lines=10) @@ | ||
| 4918 | * @psalm-return static<TKey,T> |
|
| 4919 | * @psalm-mutation-free |
|
| 4920 | */ |
|
| 4921 | public function rest(int $from = 1): self |
|
| 4922 | { |
|
| 4923 | $tmpArray = $this->toArray(); |
|
| 4924 | ||
| 4925 | return static::create( |
|
| 4926 | \array_splice($tmpArray, $from), |
|
| 4927 | $this->iteratorClass, |
|
| 4928 | false |
|
| 4929 | ); |
|
| 4930 | } |
|
| 4931 | ||
| 4932 | /** |
|
| 4933 | * Return the array in the reverse order. |
|