| @@ 3230-3237 (lines=8) @@ | ||
| 3227 | * @return static |
|
| 3228 | * <p>(Immutable)</p> |
|
| 3229 | */ |
|
| 3230 | public function removeFirst(): self |
|
| 3231 | { |
|
| 3232 | $tmpArray = $this->getArray(); |
|
| 3233 | ||
| 3234 | \array_shift($tmpArray); |
|
| 3235 | ||
| 3236 | return static::create( |
|
| 3237 | $tmpArray, |
|
| 3238 | $this->iteratorClass, |
|
| 3239 | false |
|
| 3240 | ); |
|
| @@ 3249-3256 (lines=8) @@ | ||
| 3246 | * @return static |
|
| 3247 | * <p>(Immutable)</p> |
|
| 3248 | */ |
|
| 3249 | public function removeLast(): self |
|
| 3250 | { |
|
| 3251 | $tmpArray = $this->getArray(); |
|
| 3252 | ||
| 3253 | \array_pop($tmpArray); |
|
| 3254 | ||
| 3255 | return static::create( |
|
| 3256 | $tmpArray, |
|
| 3257 | $this->iteratorClass, |
|
| 3258 | false |
|
| 3259 | ); |
|
| @@ 3442-3451 (lines=10) @@ | ||
| 3439 | * @return static |
|
| 3440 | * <p>(Immutable)</p> |
|
| 3441 | */ |
|
| 3442 | public function rest(int $from = 1): self |
|
| 3443 | { |
|
| 3444 | $tmpArray = $this->getArray(); |
|
| 3445 | ||
| 3446 | return static::create( |
|
| 3447 | \array_splice($tmpArray, $from), |
|
| 3448 | $this->iteratorClass, |
|
| 3449 | false |
|
| 3450 | ); |
|
| 3451 | } |
|
| 3452 | ||
| 3453 | /** |
|
| 3454 | * Return the array in the reverse order. |
|