Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

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