Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 5550-5561 (lines=12) @@
5547
     * @phpstan-return static<TKey,T>
5548
     * @psalm-mutation-free
5549
     */
5550
    public function removeFirst(): self
5551
    {
5552
        $tmpArray = $this->toArray();
5553
5554
        \array_shift($tmpArray);
5555
5556
        return static::create(
5557
            $tmpArray,
5558
            $this->iteratorClass,
5559
            false
5560
        );
5561
    }
5562
5563
    /**
5564
     * Remove the last value from the current array.
@@ 5576-5587 (lines=12) @@
5573
     * @phpstan-return static<TKey,T>
5574
     * @psalm-mutation-free
5575
     */
5576
    public function removeLast(): self
5577
    {
5578
        $tmpArray = $this->toArray();
5579
5580
        \array_pop($tmpArray);
5581
5582
        return static::create(
5583
            $tmpArray,
5584
            $this->iteratorClass,
5585
            false
5586
        );
5587
    }
5588
5589
    /**
5590
     * Removes a particular value from an array (numeric or associative).
@@ 5875-5884 (lines=10) @@
5872
     * @phpstan-return static<TKey,T>
5873
     * @psalm-mutation-free
5874
     */
5875
    public function rest(int $from = 1): self
5876
    {
5877
        $tmpArray = $this->toArray();
5878
5879
        return static::create(
5880
            \array_splice($tmpArray, $from),
5881
            $this->iteratorClass,
5882
            false
5883
        );
5884
    }
5885
5886
    /**
5887
     * Return the array in the reverse order.