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