| @@ 3154-3161 (lines=8) @@ | ||
| 3151 | * @return static |
|
| 3152 | * <p>(Immutable)</p> |
|
| 3153 | */ |
|
| 3154 | public function removeFirst(): self |
|
| 3155 | { |
|
| 3156 | $tmpArray = $this->getArray(); |
|
| 3157 | ||
| 3158 | \array_shift($tmpArray); |
|
| 3159 | ||
| 3160 | return static::create( |
|
| 3161 | $tmpArray, |
|
| 3162 | $this->iteratorClass, |
|
| 3163 | false |
|
| 3164 | ); |
|
| @@ 3173-3180 (lines=8) @@ | ||
| 3170 | * @return static |
|
| 3171 | * <p>(Immutable)</p> |
|
| 3172 | */ |
|
| 3173 | public function removeLast(): self |
|
| 3174 | { |
|
| 3175 | $tmpArray = $this->getArray(); |
|
| 3176 | ||
| 3177 | \array_pop($tmpArray); |
|
| 3178 | ||
| 3179 | return static::create( |
|
| 3180 | $tmpArray, |
|
| 3181 | $this->iteratorClass, |
|
| 3182 | false |
|
| 3183 | ); |
|
| @@ 3366-3375 (lines=10) @@ | ||
| 3363 | * @return static |
|
| 3364 | * <p>(Immutable)</p> |
|
| 3365 | */ |
|
| 3366 | public function rest(int $from = 1): self |
|
| 3367 | { |
|
| 3368 | $tmpArray = $this->getArray(); |
|
| 3369 | ||
| 3370 | return static::create( |
|
| 3371 | \array_splice($tmpArray, $from), |
|
| 3372 | $this->iteratorClass, |
|
| 3373 | false |
|
| 3374 | ); |
|
| 3375 | } |
|
| 3376 | ||
| 3377 | /** |
|
| 3378 | * Return the array in the reverse order. |
|