| @@ 4583-4594 (lines=12) @@ | ||
| 4580 | * @psalm-return static<TKey,T> |
|
| 4581 | * @psalm-mutation-free |
|
| 4582 | */ |
|
| 4583 | public function removeFirst(): self |
|
| 4584 | { |
|
| 4585 | $tmpArray = $this->toArray(); |
|
| 4586 | ||
| 4587 | \array_shift($tmpArray); |
|
| 4588 | ||
| 4589 | return static::create( |
|
| 4590 | $tmpArray, |
|
| 4591 | $this->iteratorClass, |
|
| 4592 | false |
|
| 4593 | ); |
|
| 4594 | } |
|
| 4595 | ||
| 4596 | /** |
|
| 4597 | * Remove the last value from the current array. |
|
| @@ 4605-4616 (lines=12) @@ | ||
| 4602 | * @psalm-return static<TKey,T> |
|
| 4603 | * @psalm-mutation-free |
|
| 4604 | */ |
|
| 4605 | public function removeLast(): self |
|
| 4606 | { |
|
| 4607 | $tmpArray = $this->toArray(); |
|
| 4608 | ||
| 4609 | \array_pop($tmpArray); |
|
| 4610 | ||
| 4611 | return static::create( |
|
| 4612 | $tmpArray, |
|
| 4613 | $this->iteratorClass, |
|
| 4614 | false |
|
| 4615 | ); |
|
| 4616 | } |
|
| 4617 | ||
| 4618 | /** |
|
| 4619 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 4832-4841 (lines=10) @@ | ||
| 4829 | * @psalm-return static<TKey,T> |
|
| 4830 | * @psalm-mutation-free |
|
| 4831 | */ |
|
| 4832 | public function rest(int $from = 1): self |
|
| 4833 | { |
|
| 4834 | $tmpArray = $this->toArray(); |
|
| 4835 | ||
| 4836 | return static::create( |
|
| 4837 | \array_splice($tmpArray, $from), |
|
| 4838 | $this->iteratorClass, |
|
| 4839 | false |
|
| 4840 | ); |
|
| 4841 | } |
|
| 4842 | ||
| 4843 | /** |
|
| 4844 | * Return the array in the reverse order. |
|