Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4626-4637 (lines=12) @@
4623
     * @psalm-return static<TKey,T>
4624
     * @psalm-mutation-free
4625
     */
4626
    public function removeFirst(): self
4627
    {
4628
        $tmpArray = $this->toArray();
4629
4630
        \array_shift($tmpArray);
4631
4632
        return static::create(
4633
            $tmpArray,
4634
            $this->iteratorClass,
4635
            false
4636
        );
4637
    }
4638
4639
    /**
4640
     * Remove the last value from the current array.
@@ 4648-4659 (lines=12) @@
4645
     * @psalm-return static<TKey,T>
4646
     * @psalm-mutation-free
4647
     */
4648
    public function removeLast(): self
4649
    {
4650
        $tmpArray = $this->toArray();
4651
4652
        \array_pop($tmpArray);
4653
4654
        return static::create(
4655
            $tmpArray,
4656
            $this->iteratorClass,
4657
            false
4658
        );
4659
    }
4660
4661
    /**
4662
     * Removes a particular value from an array (numeric or associative).
@@ 4875-4884 (lines=10) @@
4872
     * @psalm-return static<TKey,T>
4873
     * @psalm-mutation-free
4874
     */
4875
    public function rest(int $from = 1): self
4876
    {
4877
        $tmpArray = $this->toArray();
4878
4879
        return static::create(
4880
            \array_splice($tmpArray, $from),
4881
            $this->iteratorClass,
4882
            false
4883
        );
4884
    }
4885
4886
    /**
4887
     * Return the array in the reverse order.