Code Duplication    Length = 8-10 lines in 3 locations

src/Arrayy.php 3 locations

@@ 3469-3476 (lines=8) @@
3466
     * @return static
3467
     *                <p>(Immutable)</p>
3468
     */
3469
    public function removeFirst(): self
3470
    {
3471
        $tmpArray = $this->getArray();
3472
3473
        \array_shift($tmpArray);
3474
3475
        return static::create(
3476
            $tmpArray,
3477
            $this->iteratorClass,
3478
            false
3479
        );
@@ 3488-3495 (lines=8) @@
3485
     * @return static
3486
     *                <p>(Immutable)</p>
3487
     */
3488
    public function removeLast(): self
3489
    {
3490
        $tmpArray = $this->getArray();
3491
3492
        \array_pop($tmpArray);
3493
3494
        return static::create(
3495
            $tmpArray,
3496
            $this->iteratorClass,
3497
            false
3498
        );
@@ 3682-3691 (lines=10) @@
3679
     * @return static
3680
     *                <p>(Immutable)</p>
3681
     */
3682
    public function rest(int $from = 1): self
3683
    {
3684
        $tmpArray = $this->getArray();
3685
3686
        return static::create(
3687
            \array_splice($tmpArray, $from),
3688
            $this->iteratorClass,
3689
            false
3690
        );
3691
    }
3692
3693
    /**
3694
     * Return the array in the reverse order.