Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4941-4952 (lines=12) @@
4938
     * @psalm-return static<TKey,T>
4939
     * @psalm-mutation-free
4940
     */
4941
    public function removeFirst(): self
4942
    {
4943
        $tmpArray = $this->toArray();
4944
4945
        \array_shift($tmpArray);
4946
4947
        return static::create(
4948
            $tmpArray,
4949
            $this->iteratorClass,
4950
            false
4951
        );
4952
    }
4953
4954
    /**
4955
     * Remove the last value from the current array.
@@ 4963-4974 (lines=12) @@
4960
     * @psalm-return static<TKey,T>
4961
     * @psalm-mutation-free
4962
     */
4963
    public function removeLast(): self
4964
    {
4965
        $tmpArray = $this->toArray();
4966
4967
        \array_pop($tmpArray);
4968
4969
        return static::create(
4970
            $tmpArray,
4971
            $this->iteratorClass,
4972
            false
4973
        );
4974
    }
4975
4976
    /**
4977
     * Removes a particular value from an array (numeric or associative).
@@ 5190-5199 (lines=10) @@
5187
     * @psalm-return static<TKey,T>
5188
     * @psalm-mutation-free
5189
     */
5190
    public function rest(int $from = 1): self
5191
    {
5192
        $tmpArray = $this->toArray();
5193
5194
        return static::create(
5195
            \array_splice($tmpArray, $from),
5196
            $this->iteratorClass,
5197
            false
5198
        );
5199
    }
5200
5201
    /**
5202
     * Return the array in the reverse order.