Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 5327-5338 (lines=12) @@
5324
     * @psalm-return static<TKey,T>
5325
     * @psalm-mutation-free
5326
     */
5327
    public function removeFirst(): self
5328
    {
5329
        $tmpArray = $this->toArray();
5330
5331
        \array_shift($tmpArray);
5332
5333
        return static::create(
5334
            $tmpArray,
5335
            $this->iteratorClass,
5336
            false
5337
        );
5338
    }
5339
5340
    /**
5341
     * Remove the last value from the current array.
@@ 5353-5364 (lines=12) @@
5350
     * @psalm-return static<TKey,T>
5351
     * @psalm-mutation-free
5352
     */
5353
    public function removeLast(): self
5354
    {
5355
        $tmpArray = $this->toArray();
5356
5357
        \array_pop($tmpArray);
5358
5359
        return static::create(
5360
            $tmpArray,
5361
            $this->iteratorClass,
5362
            false
5363
        );
5364
    }
5365
5366
    /**
5367
     * Removes a particular value from an array (numeric or associative).
@@ 5637-5646 (lines=10) @@
5634
     * @psalm-return static<TKey,T>
5635
     * @psalm-mutation-free
5636
     */
5637
    public function rest(int $from = 1): self
5638
    {
5639
        $tmpArray = $this->toArray();
5640
5641
        return static::create(
5642
            \array_splice($tmpArray, $from),
5643
            $this->iteratorClass,
5644
            false
5645
        );
5646
    }
5647
5648
    /**
5649
     * Return the array in the reverse order.