Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4845-4856 (lines=12) @@
4842
     * @psalm-return static<TKey,T>
4843
     * @psalm-mutation-free
4844
     */
4845
    public function removeFirst(): self
4846
    {
4847
        $tmpArray = $this->toArray();
4848
4849
        \array_shift($tmpArray);
4850
4851
        return static::create(
4852
            $tmpArray,
4853
            $this->iteratorClass,
4854
            false
4855
        );
4856
    }
4857
4858
    /**
4859
     * Remove the last value from the current array.
@@ 4867-4878 (lines=12) @@
4864
     * @psalm-return static<TKey,T>
4865
     * @psalm-mutation-free
4866
     */
4867
    public function removeLast(): self
4868
    {
4869
        $tmpArray = $this->toArray();
4870
4871
        \array_pop($tmpArray);
4872
4873
        return static::create(
4874
            $tmpArray,
4875
            $this->iteratorClass,
4876
            false
4877
        );
4878
    }
4879
4880
    /**
4881
     * Removes a particular value from an array (numeric or associative).
@@ 5094-5103 (lines=10) @@
5091
     * @psalm-return static<TKey,T>
5092
     * @psalm-mutation-free
5093
     */
5094
    public function rest(int $from = 1): self
5095
    {
5096
        $tmpArray = $this->toArray();
5097
5098
        return static::create(
5099
            \array_splice($tmpArray, $from),
5100
            $this->iteratorClass,
5101
            false
5102
        );
5103
    }
5104
5105
    /**
5106
     * Return the array in the reverse order.