| @@ 3810-3817 (lines=8) @@ | ||
| 3807 | * @return static |
|
| 3808 | * <p>(Immutable)</p> |
|
| 3809 | */ |
|
| 3810 | public function removeFirst(): self |
|
| 3811 | { |
|
| 3812 | $tmpArray = $this->getArray(); |
|
| 3813 | ||
| 3814 | \array_shift($tmpArray); |
|
| 3815 | ||
| 3816 | return static::create( |
|
| 3817 | $tmpArray, |
|
| 3818 | $this->iteratorClass, |
|
| 3819 | false |
|
| 3820 | ); |
|
| @@ 3829-3836 (lines=8) @@ | ||
| 3826 | * @return static |
|
| 3827 | * <p>(Immutable)</p> |
|
| 3828 | */ |
|
| 3829 | public function removeLast(): self |
|
| 3830 | { |
|
| 3831 | $tmpArray = $this->getArray(); |
|
| 3832 | ||
| 3833 | \array_pop($tmpArray); |
|
| 3834 | ||
| 3835 | return static::create( |
|
| 3836 | $tmpArray, |
|
| 3837 | $this->iteratorClass, |
|
| 3838 | false |
|
| 3839 | ); |
|
| @@ 4018-4027 (lines=10) @@ | ||
| 4015 | * @return static |
|
| 4016 | * <p>(Immutable)</p> |
|
| 4017 | */ |
|
| 4018 | public function rest(int $from = 1): self |
|
| 4019 | { |
|
| 4020 | $tmpArray = $this->getArray(); |
|
| 4021 | ||
| 4022 | return static::create( |
|
| 4023 | \array_splice($tmpArray, $from), |
|
| 4024 | $this->iteratorClass, |
|
| 4025 | false |
|
| 4026 | ); |
|
| 4027 | } |
|
| 4028 | ||
| 4029 | /** |
|
| 4030 | * Return the array in the reverse order. |
|