| @@ 4445-4456 (lines=12) @@ | ||
| 4442 | * @psalm-return static<TKey,T> |
|
| 4443 | * @psalm-mutation-free |
|
| 4444 | */ |
|
| 4445 | public function removeFirst(): self |
|
| 4446 | { |
|
| 4447 | $tmpArray = $this->toArray(); |
|
| 4448 | ||
| 4449 | \array_shift($tmpArray); |
|
| 4450 | ||
| 4451 | return static::create( |
|
| 4452 | $tmpArray, |
|
| 4453 | $this->iteratorClass, |
|
| 4454 | false |
|
| 4455 | ); |
|
| 4456 | } |
|
| 4457 | ||
| 4458 | /** |
|
| 4459 | * Remove the last value from the current array. |
|
| @@ 4467-4478 (lines=12) @@ | ||
| 4464 | * @psalm-return static<TKey,T> |
|
| 4465 | * @psalm-mutation-free |
|
| 4466 | */ |
|
| 4467 | public function removeLast(): self |
|
| 4468 | { |
|
| 4469 | $tmpArray = $this->toArray(); |
|
| 4470 | ||
| 4471 | \array_pop($tmpArray); |
|
| 4472 | ||
| 4473 | return static::create( |
|
| 4474 | $tmpArray, |
|
| 4475 | $this->iteratorClass, |
|
| 4476 | false |
|
| 4477 | ); |
|
| 4478 | } |
|
| 4479 | ||
| 4480 | /** |
|
| 4481 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 4694-4703 (lines=10) @@ | ||
| 4691 | * @psalm-return static<TKey,T> |
|
| 4692 | * @psalm-mutation-free |
|
| 4693 | */ |
|
| 4694 | public function rest(int $from = 1): self |
|
| 4695 | { |
|
| 4696 | $tmpArray = $this->toArray(); |
|
| 4697 | ||
| 4698 | return static::create( |
|
| 4699 | \array_splice($tmpArray, $from), |
|
| 4700 | $this->iteratorClass, |
|
| 4701 | false |
|
| 4702 | ); |
|
| 4703 | } |
|
| 4704 | ||
| 4705 | /** |
|
| 4706 | * Return the array in the reverse order. |
|