Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 5237-5248 (lines=12) @@
5234
     * @psalm-return static<TKey,T>
5235
     * @psalm-mutation-free
5236
     */
5237
    public function removeFirst(): self
5238
    {
5239
        $tmpArray = $this->toArray();
5240
5241
        \array_shift($tmpArray);
5242
5243
        return static::create(
5244
            $tmpArray,
5245
            $this->iteratorClass,
5246
            false
5247
        );
5248
    }
5249
5250
    /**
5251
     * Remove the last value from the current array.
@@ 5263-5274 (lines=12) @@
5260
     * @psalm-return static<TKey,T>
5261
     * @psalm-mutation-free
5262
     */
5263
    public function removeLast(): self
5264
    {
5265
        $tmpArray = $this->toArray();
5266
5267
        \array_pop($tmpArray);
5268
5269
        return static::create(
5270
            $tmpArray,
5271
            $this->iteratorClass,
5272
            false
5273
        );
5274
    }
5275
5276
    /**
5277
     * Removes a particular value from an array (numeric or associative).
@@ 5547-5556 (lines=10) @@
5544
     * @psalm-return static<TKey,T>
5545
     * @psalm-mutation-free
5546
     */
5547
    public function rest(int $from = 1): self
5548
    {
5549
        $tmpArray = $this->toArray();
5550
5551
        return static::create(
5552
            \array_splice($tmpArray, $from),
5553
            $this->iteratorClass,
5554
            false
5555
        );
5556
    }
5557
5558
    /**
5559
     * Return the array in the reverse order.