| @@ 3582-3589 (lines=8) @@ | ||
| 3579 | * @return static |
|
| 3580 | * <p>(Immutable)</p> |
|
| 3581 | */ |
|
| 3582 | public function removeFirst(): self |
|
| 3583 | { |
|
| 3584 | $tmpArray = $this->getArray(); |
|
| 3585 | ||
| 3586 | \array_shift($tmpArray); |
|
| 3587 | ||
| 3588 | return static::create( |
|
| 3589 | $tmpArray, |
|
| 3590 | $this->iteratorClass, |
|
| 3591 | false |
|
| 3592 | ); |
|
| @@ 3601-3608 (lines=8) @@ | ||
| 3598 | * @return static |
|
| 3599 | * <p>(Immutable)</p> |
|
| 3600 | */ |
|
| 3601 | public function removeLast(): self |
|
| 3602 | { |
|
| 3603 | $tmpArray = $this->getArray(); |
|
| 3604 | ||
| 3605 | \array_pop($tmpArray); |
|
| 3606 | ||
| 3607 | return static::create( |
|
| 3608 | $tmpArray, |
|
| 3609 | $this->iteratorClass, |
|
| 3610 | false |
|
| 3611 | ); |
|
| @@ 3793-3802 (lines=10) @@ | ||
| 3790 | * @return static |
|
| 3791 | * <p>(Immutable)</p> |
|
| 3792 | */ |
|
| 3793 | public function rest(int $from = 1): self |
|
| 3794 | { |
|
| 3795 | $tmpArray = $this->getArray(); |
|
| 3796 | ||
| 3797 | return static::create( |
|
| 3798 | \array_splice($tmpArray, $from), |
|
| 3799 | $this->iteratorClass, |
|
| 3800 | false |
|
| 3801 | ); |
|
| 3802 | } |
|
| 3803 | ||
| 3804 | /** |
|
| 3805 | * Return the array in the reverse order. |
|