| @@ 3627-3634 (lines=8) @@ | ||
| 3624 | * @return static |
|
| 3625 | * <p>(Immutable)</p> |
|
| 3626 | */ |
|
| 3627 | public function removeFirst(): self |
|
| 3628 | { |
|
| 3629 | $tmpArray = $this->getArray(); |
|
| 3630 | ||
| 3631 | \array_shift($tmpArray); |
|
| 3632 | ||
| 3633 | return static::create( |
|
| 3634 | $tmpArray, |
|
| 3635 | $this->iteratorClass, |
|
| 3636 | false |
|
| 3637 | ); |
|
| @@ 3646-3653 (lines=8) @@ | ||
| 3643 | * @return static |
|
| 3644 | * <p>(Immutable)</p> |
|
| 3645 | */ |
|
| 3646 | public function removeLast(): self |
|
| 3647 | { |
|
| 3648 | $tmpArray = $this->getArray(); |
|
| 3649 | ||
| 3650 | \array_pop($tmpArray); |
|
| 3651 | ||
| 3652 | return static::create( |
|
| 3653 | $tmpArray, |
|
| 3654 | $this->iteratorClass, |
|
| 3655 | false |
|
| 3656 | ); |
|
| @@ 3838-3847 (lines=10) @@ | ||
| 3835 | * @return static |
|
| 3836 | * <p>(Immutable)</p> |
|
| 3837 | */ |
|
| 3838 | public function rest(int $from = 1): self |
|
| 3839 | { |
|
| 3840 | $tmpArray = $this->getArray(); |
|
| 3841 | ||
| 3842 | return static::create( |
|
| 3843 | \array_splice($tmpArray, $from), |
|
| 3844 | $this->iteratorClass, |
|
| 3845 | false |
|
| 3846 | ); |
|
| 3847 | } |
|
| 3848 | ||
| 3849 | /** |
|
| 3850 | * @param int $offset |
|