Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 5526-5537 (lines=12) @@
5523
     * @phpstan-return static<TKey,T>
5524
     * @psalm-mutation-free
5525
     */
5526
    public function removeFirst(): self
5527
    {
5528
        $tmpArray = $this->toArray();
5529
5530
        \array_shift($tmpArray);
5531
5532
        return static::create(
5533
            $tmpArray,
5534
            $this->iteratorClass,
5535
            false
5536
        );
5537
    }
5538
5539
    /**
5540
     * Remove the last value from the current array.
@@ 5552-5563 (lines=12) @@
5549
     * @phpstan-return static<TKey,T>
5550
     * @psalm-mutation-free
5551
     */
5552
    public function removeLast(): self
5553
    {
5554
        $tmpArray = $this->toArray();
5555
5556
        \array_pop($tmpArray);
5557
5558
        return static::create(
5559
            $tmpArray,
5560
            $this->iteratorClass,
5561
            false
5562
        );
5563
    }
5564
5565
    /**
5566
     * Removes a particular value from an array (numeric or associative).
@@ 5851-5860 (lines=10) @@
5848
     * @phpstan-return static<TKey,T>
5849
     * @psalm-mutation-free
5850
     */
5851
    public function rest(int $from = 1): self
5852
    {
5853
        $tmpArray = $this->toArray();
5854
5855
        return static::create(
5856
            \array_splice($tmpArray, $from),
5857
            $this->iteratorClass,
5858
            false
5859
        );
5860
    }
5861
5862
    /**
5863
     * Return the array in the reverse order.