| @@ 4817-4828 (lines=12) @@ | ||
| 4814 | * @psalm-return static<TKey,T> |
|
| 4815 | * @psalm-mutation-free |
|
| 4816 | */ |
|
| 4817 | public function removeFirst(): self |
|
| 4818 | { |
|
| 4819 | $tmpArray = $this->toArray(); |
|
| 4820 | ||
| 4821 | \array_shift($tmpArray); |
|
| 4822 | ||
| 4823 | return static::create( |
|
| 4824 | $tmpArray, |
|
| 4825 | $this->iteratorClass, |
|
| 4826 | false |
|
| 4827 | ); |
|
| 4828 | } |
|
| 4829 | ||
| 4830 | /** |
|
| 4831 | * Remove the last value from the current array. |
|
| @@ 4839-4850 (lines=12) @@ | ||
| 4836 | * @psalm-return static<TKey,T> |
|
| 4837 | * @psalm-mutation-free |
|
| 4838 | */ |
|
| 4839 | public function removeLast(): self |
|
| 4840 | { |
|
| 4841 | $tmpArray = $this->toArray(); |
|
| 4842 | ||
| 4843 | \array_pop($tmpArray); |
|
| 4844 | ||
| 4845 | return static::create( |
|
| 4846 | $tmpArray, |
|
| 4847 | $this->iteratorClass, |
|
| 4848 | false |
|
| 4849 | ); |
|
| 4850 | } |
|
| 4851 | ||
| 4852 | /** |
|
| 4853 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 5066-5075 (lines=10) @@ | ||
| 5063 | * @psalm-return static<TKey,T> |
|
| 5064 | * @psalm-mutation-free |
|
| 5065 | */ |
|
| 5066 | public function rest(int $from = 1): self |
|
| 5067 | { |
|
| 5068 | $tmpArray = $this->toArray(); |
|
| 5069 | ||
| 5070 | return static::create( |
|
| 5071 | \array_splice($tmpArray, $from), |
|
| 5072 | $this->iteratorClass, |
|
| 5073 | false |
|
| 5074 | ); |
|
| 5075 | } |
|
| 5076 | ||
| 5077 | /** |
|
| 5078 | * Return the array in the reverse order. |
|