Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4709-4720 (lines=12) @@
4706
     * @psalm-return static<TKey,T>
4707
     * @psalm-mutation-free
4708
     */
4709
    public function removeFirst(): self
4710
    {
4711
        $tmpArray = $this->toArray();
4712
4713
        \array_shift($tmpArray);
4714
4715
        return static::create(
4716
            $tmpArray,
4717
            $this->iteratorClass,
4718
            false
4719
        );
4720
    }
4721
4722
    /**
4723
     * Remove the last value from the current array.
@@ 4731-4742 (lines=12) @@
4728
     * @psalm-return static<TKey,T>
4729
     * @psalm-mutation-free
4730
     */
4731
    public function removeLast(): self
4732
    {
4733
        $tmpArray = $this->toArray();
4734
4735
        \array_pop($tmpArray);
4736
4737
        return static::create(
4738
            $tmpArray,
4739
            $this->iteratorClass,
4740
            false
4741
        );
4742
    }
4743
4744
    /**
4745
     * Removes a particular value from an array (numeric or associative).
@@ 4958-4967 (lines=10) @@
4955
     * @psalm-return static<TKey,T>
4956
     * @psalm-mutation-free
4957
     */
4958
    public function rest(int $from = 1): self
4959
    {
4960
        $tmpArray = $this->toArray();
4961
4962
        return static::create(
4963
            \array_splice($tmpArray, $from),
4964
            $this->iteratorClass,
4965
            false
4966
        );
4967
    }
4968
4969
    /**
4970
     * Return the array in the reverse order.