| @@ 5527-5538 (lines=12) @@ | ||
| 5524 | * @phpstan-return static<TKey,T> |
|
| 5525 | * @psalm-mutation-free |
|
| 5526 | */ |
|
| 5527 | public function removeFirst(): self |
|
| 5528 | { |
|
| 5529 | $tmpArray = $this->toArray(); |
|
| 5530 | ||
| 5531 | \array_shift($tmpArray); |
|
| 5532 | ||
| 5533 | return static::create( |
|
| 5534 | $tmpArray, |
|
| 5535 | $this->iteratorClass, |
|
| 5536 | false |
|
| 5537 | ); |
|
| 5538 | } |
|
| 5539 | ||
| 5540 | /** |
|
| 5541 | * Remove the last value from the current array. |
|
| @@ 5553-5564 (lines=12) @@ | ||
| 5550 | * @phpstan-return static<TKey,T> |
|
| 5551 | * @psalm-mutation-free |
|
| 5552 | */ |
|
| 5553 | public function removeLast(): self |
|
| 5554 | { |
|
| 5555 | $tmpArray = $this->toArray(); |
|
| 5556 | ||
| 5557 | \array_pop($tmpArray); |
|
| 5558 | ||
| 5559 | return static::create( |
|
| 5560 | $tmpArray, |
|
| 5561 | $this->iteratorClass, |
|
| 5562 | false |
|
| 5563 | ); |
|
| 5564 | } |
|
| 5565 | ||
| 5566 | /** |
|
| 5567 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 5852-5861 (lines=10) @@ | ||
| 5849 | * @phpstan-return static<TKey,T> |
|
| 5850 | * @psalm-mutation-free |
|
| 5851 | */ |
|
| 5852 | public function rest(int $from = 1): self |
|
| 5853 | { |
|
| 5854 | $tmpArray = $this->toArray(); |
|
| 5855 | ||
| 5856 | return static::create( |
|
| 5857 | \array_splice($tmpArray, $from), |
|
| 5858 | $this->iteratorClass, |
|
| 5859 | false |
|
| 5860 | ); |
|
| 5861 | } |
|
| 5862 | ||
| 5863 | /** |
|
| 5864 | * Return the array in the reverse order. |
|