| @@ 4835-4846 (lines=12) @@ | ||
| 4832 | * @psalm-return static<TKey,T> |
|
| 4833 | * @psalm-mutation-free |
|
| 4834 | */ |
|
| 4835 | public function removeFirst(): self |
|
| 4836 | { |
|
| 4837 | $tmpArray = $this->toArray(); |
|
| 4838 | ||
| 4839 | \array_shift($tmpArray); |
|
| 4840 | ||
| 4841 | return static::create( |
|
| 4842 | $tmpArray, |
|
| 4843 | $this->iteratorClass, |
|
| 4844 | false |
|
| 4845 | ); |
|
| 4846 | } |
|
| 4847 | ||
| 4848 | /** |
|
| 4849 | * Remove the last value from the current array. |
|
| @@ 4857-4868 (lines=12) @@ | ||
| 4854 | * @psalm-return static<TKey,T> |
|
| 4855 | * @psalm-mutation-free |
|
| 4856 | */ |
|
| 4857 | public function removeLast(): self |
|
| 4858 | { |
|
| 4859 | $tmpArray = $this->toArray(); |
|
| 4860 | ||
| 4861 | \array_pop($tmpArray); |
|
| 4862 | ||
| 4863 | return static::create( |
|
| 4864 | $tmpArray, |
|
| 4865 | $this->iteratorClass, |
|
| 4866 | false |
|
| 4867 | ); |
|
| 4868 | } |
|
| 4869 | ||
| 4870 | /** |
|
| 4871 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 5084-5093 (lines=10) @@ | ||
| 5081 | * @psalm-return static<TKey,T> |
|
| 5082 | * @psalm-mutation-free |
|
| 5083 | */ |
|
| 5084 | public function rest(int $from = 1): self |
|
| 5085 | { |
|
| 5086 | $tmpArray = $this->toArray(); |
|
| 5087 | ||
| 5088 | return static::create( |
|
| 5089 | \array_splice($tmpArray, $from), |
|
| 5090 | $this->iteratorClass, |
|
| 5091 | false |
|
| 5092 | ); |
|
| 5093 | } |
|
| 5094 | ||
| 5095 | /** |
|
| 5096 | * Return the array in the reverse order. |
|