| @@ 3795-3802 (lines=8) @@ | ||
| 3792 | * @return static |
|
| 3793 | * <p>(Immutable)</p> |
|
| 3794 | */ |
|
| 3795 | public function removeFirst(): self |
|
| 3796 | { |
|
| 3797 | $tmpArray = $this->getArray(); |
|
| 3798 | ||
| 3799 | \array_shift($tmpArray); |
|
| 3800 | ||
| 3801 | return static::create( |
|
| 3802 | $tmpArray, |
|
| 3803 | $this->iteratorClass, |
|
| 3804 | false |
|
| 3805 | ); |
|
| @@ 3814-3821 (lines=8) @@ | ||
| 3811 | * @return static |
|
| 3812 | * <p>(Immutable)</p> |
|
| 3813 | */ |
|
| 3814 | public function removeLast(): self |
|
| 3815 | { |
|
| 3816 | $tmpArray = $this->getArray(); |
|
| 3817 | ||
| 3818 | \array_pop($tmpArray); |
|
| 3819 | ||
| 3820 | return static::create( |
|
| 3821 | $tmpArray, |
|
| 3822 | $this->iteratorClass, |
|
| 3823 | false |
|
| 3824 | ); |
|
| @@ 4003-4012 (lines=10) @@ | ||
| 4000 | * @return static |
|
| 4001 | * <p>(Immutable)</p> |
|
| 4002 | */ |
|
| 4003 | public function rest(int $from = 1): self |
|
| 4004 | { |
|
| 4005 | $tmpArray = $this->getArray(); |
|
| 4006 | ||
| 4007 | return static::create( |
|
| 4008 | \array_splice($tmpArray, $from), |
|
| 4009 | $this->iteratorClass, |
|
| 4010 | false |
|
| 4011 | ); |
|
| 4012 | } |
|
| 4013 | ||
| 4014 | /** |
|
| 4015 | * Return the array in the reverse order. |
|