| @@ 3210-3217 (lines=8) @@ | ||
| 3207 | * @return static |
|
| 3208 | * <p>(Immutable)</p> |
|
| 3209 | */ |
|
| 3210 | public function removeFirst(): self |
|
| 3211 | { |
|
| 3212 | $tmpArray = $this->getArray(); |
|
| 3213 | ||
| 3214 | \array_shift($tmpArray); |
|
| 3215 | ||
| 3216 | return static::create( |
|
| 3217 | $tmpArray, |
|
| 3218 | $this->iteratorClass, |
|
| 3219 | false |
|
| 3220 | ); |
|
| @@ 3229-3236 (lines=8) @@ | ||
| 3226 | * @return static |
|
| 3227 | * <p>(Immutable)</p> |
|
| 3228 | */ |
|
| 3229 | public function removeLast(): self |
|
| 3230 | { |
|
| 3231 | $tmpArray = $this->getArray(); |
|
| 3232 | ||
| 3233 | \array_pop($tmpArray); |
|
| 3234 | ||
| 3235 | return static::create( |
|
| 3236 | $tmpArray, |
|
| 3237 | $this->iteratorClass, |
|
| 3238 | false |
|
| 3239 | ); |
|
| @@ 3422-3431 (lines=10) @@ | ||
| 3419 | * @return static |
|
| 3420 | * <p>(Immutable)</p> |
|
| 3421 | */ |
|
| 3422 | public function rest(int $from = 1): self |
|
| 3423 | { |
|
| 3424 | $tmpArray = $this->getArray(); |
|
| 3425 | ||
| 3426 | return static::create( |
|
| 3427 | \array_splice($tmpArray, $from), |
|
| 3428 | $this->iteratorClass, |
|
| 3429 | false |
|
| 3430 | ); |
|
| 3431 | } |
|
| 3432 | ||
| 3433 | /** |
|
| 3434 | * Return the array in the reverse order. |
|