Code Duplication    Length = 8-10 lines in 3 locations

src/Arrayy.php 3 locations

@@ 3151-3158 (lines=8) @@
3148
     * @return static
3149
     *                <p>(Immutable)</p>
3150
     */
3151
    public function removeFirst(): self
3152
    {
3153
        $tmpArray = $this->getArray();
3154
3155
        \array_shift($tmpArray);
3156
3157
        return static::create(
3158
            $tmpArray,
3159
            $this->iteratorClass,
3160
            false
3161
        );
@@ 3170-3177 (lines=8) @@
3167
     * @return static
3168
     *                <p>(Immutable)</p>
3169
     */
3170
    public function removeLast(): self
3171
    {
3172
        $tmpArray = $this->getArray();
3173
3174
        \array_pop($tmpArray);
3175
3176
        return static::create(
3177
            $tmpArray,
3178
            $this->iteratorClass,
3179
            false
3180
        );
@@ 3363-3372 (lines=10) @@
3360
     * @return static
3361
     *                <p>(Immutable)</p>
3362
     */
3363
    public function rest(int $from = 1): self
3364
    {
3365
        $tmpArray = $this->getArray();
3366
3367
        return static::create(
3368
            \array_splice($tmpArray, $from),
3369
            $this->iteratorClass,
3370
            false
3371
        );
3372
    }
3373
3374
    /**
3375
     * Return the array in the reverse order.