| @@ 4593-4604 (lines=12) @@ | ||
| 4590 | * @psalm-return static<TKey,T> |
|
| 4591 | * @psalm-mutation-free |
|
| 4592 | */ |
|
| 4593 | public function removeFirst(): self |
|
| 4594 | { |
|
| 4595 | $tmpArray = $this->toArray(); |
|
| 4596 | ||
| 4597 | \array_shift($tmpArray); |
|
| 4598 | ||
| 4599 | return static::create( |
|
| 4600 | $tmpArray, |
|
| 4601 | $this->iteratorClass, |
|
| 4602 | false |
|
| 4603 | ); |
|
| 4604 | } |
|
| 4605 | ||
| 4606 | /** |
|
| 4607 | * Remove the last value from the current array. |
|
| @@ 4615-4626 (lines=12) @@ | ||
| 4612 | * @psalm-return static<TKey,T> |
|
| 4613 | * @psalm-mutation-free |
|
| 4614 | */ |
|
| 4615 | public function removeLast(): self |
|
| 4616 | { |
|
| 4617 | $tmpArray = $this->toArray(); |
|
| 4618 | ||
| 4619 | \array_pop($tmpArray); |
|
| 4620 | ||
| 4621 | return static::create( |
|
| 4622 | $tmpArray, |
|
| 4623 | $this->iteratorClass, |
|
| 4624 | false |
|
| 4625 | ); |
|
| 4626 | } |
|
| 4627 | ||
| 4628 | /** |
|
| 4629 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 4842-4851 (lines=10) @@ | ||
| 4839 | * @psalm-return static<TKey,T> |
|
| 4840 | * @psalm-mutation-free |
|
| 4841 | */ |
|
| 4842 | public function rest(int $from = 1): self |
|
| 4843 | { |
|
| 4844 | $tmpArray = $this->toArray(); |
|
| 4845 | ||
| 4846 | return static::create( |
|
| 4847 | \array_splice($tmpArray, $from), |
|
| 4848 | $this->iteratorClass, |
|
| 4849 | false |
|
| 4850 | ); |
|
| 4851 | } |
|
| 4852 | ||
| 4853 | /** |
|
| 4854 | * Return the array in the reverse order. |
|