| @@ 3564-3571 (lines=8) @@ | ||
| 3561 | * @return static |
|
| 3562 | * <p>(Immutable)</p> |
|
| 3563 | */ |
|
| 3564 | public function removeFirst(): self |
|
| 3565 | { |
|
| 3566 | $tmpArray = $this->getArray(); |
|
| 3567 | ||
| 3568 | \array_shift($tmpArray); |
|
| 3569 | ||
| 3570 | return static::create( |
|
| 3571 | $tmpArray, |
|
| 3572 | $this->iteratorClass, |
|
| 3573 | false |
|
| 3574 | ); |
|
| @@ 3583-3590 (lines=8) @@ | ||
| 3580 | * @return static |
|
| 3581 | * <p>(Immutable)</p> |
|
| 3582 | */ |
|
| 3583 | public function removeLast(): self |
|
| 3584 | { |
|
| 3585 | $tmpArray = $this->getArray(); |
|
| 3586 | ||
| 3587 | \array_pop($tmpArray); |
|
| 3588 | ||
| 3589 | return static::create( |
|
| 3590 | $tmpArray, |
|
| 3591 | $this->iteratorClass, |
|
| 3592 | false |
|
| 3593 | ); |
|
| @@ 3777-3786 (lines=10) @@ | ||
| 3774 | * @return static |
|
| 3775 | * <p>(Immutable)</p> |
|
| 3776 | */ |
|
| 3777 | public function rest(int $from = 1): self |
|
| 3778 | { |
|
| 3779 | $tmpArray = $this->getArray(); |
|
| 3780 | ||
| 3781 | return static::create( |
|
| 3782 | \array_splice($tmpArray, $from), |
|
| 3783 | $this->iteratorClass, |
|
| 3784 | false |
|
| 3785 | ); |
|
| 3786 | } |
|
| 3787 | ||
| 3788 | /** |
|
| 3789 | * Return the array in the reverse order. |
|