| @@ 3283-3290 (lines=8) @@ | ||
| 3280 | * @return static |
|
| 3281 | * <p>(Immutable)</p> |
|
| 3282 | */ |
|
| 3283 | public function removeFirst(): self |
|
| 3284 | { |
|
| 3285 | $tmpArray = $this->getArray(); |
|
| 3286 | ||
| 3287 | \array_shift($tmpArray); |
|
| 3288 | ||
| 3289 | return static::create( |
|
| 3290 | $tmpArray, |
|
| 3291 | $this->iteratorClass, |
|
| 3292 | false |
|
| 3293 | ); |
|
| @@ 3302-3309 (lines=8) @@ | ||
| 3299 | * @return static |
|
| 3300 | * <p>(Immutable)</p> |
|
| 3301 | */ |
|
| 3302 | public function removeLast(): self |
|
| 3303 | { |
|
| 3304 | $tmpArray = $this->getArray(); |
|
| 3305 | ||
| 3306 | \array_pop($tmpArray); |
|
| 3307 | ||
| 3308 | return static::create( |
|
| 3309 | $tmpArray, |
|
| 3310 | $this->iteratorClass, |
|
| 3311 | false |
|
| 3312 | ); |
|
| @@ 3496-3505 (lines=10) @@ | ||
| 3493 | * @return static |
|
| 3494 | * <p>(Immutable)</p> |
|
| 3495 | */ |
|
| 3496 | public function rest(int $from = 1): self |
|
| 3497 | { |
|
| 3498 | $tmpArray = $this->getArray(); |
|
| 3499 | ||
| 3500 | return static::create( |
|
| 3501 | \array_splice($tmpArray, $from), |
|
| 3502 | $this->iteratorClass, |
|
| 3503 | false |
|
| 3504 | ); |
|
| 3505 | } |
|
| 3506 | ||
| 3507 | /** |
|
| 3508 | * Return the array in the reverse order. |
|