| @@ 4662-4673 (lines=12) @@ | ||
| 4659 | * @psalm-return static<TKey,T> |
|
| 4660 | * @psalm-mutation-free |
|
| 4661 | */ |
|
| 4662 | public function removeFirst(): self |
|
| 4663 | { |
|
| 4664 | $tmpArray = $this->toArray(); |
|
| 4665 | ||
| 4666 | \array_shift($tmpArray); |
|
| 4667 | ||
| 4668 | return static::create( |
|
| 4669 | $tmpArray, |
|
| 4670 | $this->iteratorClass, |
|
| 4671 | false |
|
| 4672 | ); |
|
| 4673 | } |
|
| 4674 | ||
| 4675 | /** |
|
| 4676 | * Remove the last value from the current array. |
|
| @@ 4684-4695 (lines=12) @@ | ||
| 4681 | * @psalm-return static<TKey,T> |
|
| 4682 | * @psalm-mutation-free |
|
| 4683 | */ |
|
| 4684 | public function removeLast(): self |
|
| 4685 | { |
|
| 4686 | $tmpArray = $this->toArray(); |
|
| 4687 | ||
| 4688 | \array_pop($tmpArray); |
|
| 4689 | ||
| 4690 | return static::create( |
|
| 4691 | $tmpArray, |
|
| 4692 | $this->iteratorClass, |
|
| 4693 | false |
|
| 4694 | ); |
|
| 4695 | } |
|
| 4696 | ||
| 4697 | /** |
|
| 4698 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 4911-4920 (lines=10) @@ | ||
| 4908 | * @psalm-return static<TKey,T> |
|
| 4909 | * @psalm-mutation-free |
|
| 4910 | */ |
|
| 4911 | public function rest(int $from = 1): self |
|
| 4912 | { |
|
| 4913 | $tmpArray = $this->toArray(); |
|
| 4914 | ||
| 4915 | return static::create( |
|
| 4916 | \array_splice($tmpArray, $from), |
|
| 4917 | $this->iteratorClass, |
|
| 4918 | false |
|
| 4919 | ); |
|
| 4920 | } |
|
| 4921 | ||
| 4922 | /** |
|
| 4923 | * Return the array in the reverse order. |
|