| @@ 3297-3304 (lines=8) @@ | ||
| 3294 | * @return static |
|
| 3295 | * <p>(Immutable)</p> |
|
| 3296 | */ |
|
| 3297 | public function removeFirst(): self |
|
| 3298 | { |
|
| 3299 | $tmpArray = $this->getArray(); |
|
| 3300 | ||
| 3301 | \array_shift($tmpArray); |
|
| 3302 | ||
| 3303 | return static::create( |
|
| 3304 | $tmpArray, |
|
| 3305 | $this->iteratorClass, |
|
| 3306 | false |
|
| 3307 | ); |
|
| @@ 3316-3323 (lines=8) @@ | ||
| 3313 | * @return static |
|
| 3314 | * <p>(Immutable)</p> |
|
| 3315 | */ |
|
| 3316 | public function removeLast(): self |
|
| 3317 | { |
|
| 3318 | $tmpArray = $this->getArray(); |
|
| 3319 | ||
| 3320 | \array_pop($tmpArray); |
|
| 3321 | ||
| 3322 | return static::create( |
|
| 3323 | $tmpArray, |
|
| 3324 | $this->iteratorClass, |
|
| 3325 | false |
|
| 3326 | ); |
|
| @@ 3510-3519 (lines=10) @@ | ||
| 3507 | * @return static |
|
| 3508 | * <p>(Immutable)</p> |
|
| 3509 | */ |
|
| 3510 | public function rest(int $from = 1): self |
|
| 3511 | { |
|
| 3512 | $tmpArray = $this->getArray(); |
|
| 3513 | ||
| 3514 | return static::create( |
|
| 3515 | \array_splice($tmpArray, $from), |
|
| 3516 | $this->iteratorClass, |
|
| 3517 | false |
|
| 3518 | ); |
|
| 3519 | } |
|
| 3520 | ||
| 3521 | /** |
|
| 3522 | * Return the array in the reverse order. |
|