| @@ 4846-4857 (lines=12) @@ | ||
| 4843 | * @psalm-return static<TKey,T> |
|
| 4844 | * @psalm-mutation-free |
|
| 4845 | */ |
|
| 4846 | public function removeFirst(): self |
|
| 4847 | { |
|
| 4848 | $tmpArray = $this->toArray(); |
|
| 4849 | ||
| 4850 | \array_shift($tmpArray); |
|
| 4851 | ||
| 4852 | return static::create( |
|
| 4853 | $tmpArray, |
|
| 4854 | $this->iteratorClass, |
|
| 4855 | false |
|
| 4856 | ); |
|
| 4857 | } |
|
| 4858 | ||
| 4859 | /** |
|
| 4860 | * Remove the last value from the current array. |
|
| @@ 4868-4879 (lines=12) @@ | ||
| 4865 | * @psalm-return static<TKey,T> |
|
| 4866 | * @psalm-mutation-free |
|
| 4867 | */ |
|
| 4868 | public function removeLast(): self |
|
| 4869 | { |
|
| 4870 | $tmpArray = $this->toArray(); |
|
| 4871 | ||
| 4872 | \array_pop($tmpArray); |
|
| 4873 | ||
| 4874 | return static::create( |
|
| 4875 | $tmpArray, |
|
| 4876 | $this->iteratorClass, |
|
| 4877 | false |
|
| 4878 | ); |
|
| 4879 | } |
|
| 4880 | ||
| 4881 | /** |
|
| 4882 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 5095-5104 (lines=10) @@ | ||
| 5092 | * @psalm-return static<TKey,T> |
|
| 5093 | * @psalm-mutation-free |
|
| 5094 | */ |
|
| 5095 | public function rest(int $from = 1): self |
|
| 5096 | { |
|
| 5097 | $tmpArray = $this->toArray(); |
|
| 5098 | ||
| 5099 | return static::create( |
|
| 5100 | \array_splice($tmpArray, $from), |
|
| 5101 | $this->iteratorClass, |
|
| 5102 | false |
|
| 5103 | ); |
|
| 5104 | } |
|
| 5105 | ||
| 5106 | /** |
|
| 5107 | * Return the array in the reverse order. |
|