Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

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