Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 5354-5365 (lines=12) @@
5351
     * @psalm-return static<TKey,T>
5352
     * @psalm-mutation-free
5353
     */
5354
    public function removeFirst(): self
5355
    {
5356
        $tmpArray = $this->toArray();
5357
5358
        \array_shift($tmpArray);
5359
5360
        return static::create(
5361
            $tmpArray,
5362
            $this->iteratorClass,
5363
            false
5364
        );
5365
    }
5366
5367
    /**
5368
     * Remove the last value from the current array.
@@ 5380-5391 (lines=12) @@
5377
     * @psalm-return static<TKey,T>
5378
     * @psalm-mutation-free
5379
     */
5380
    public function removeLast(): self
5381
    {
5382
        $tmpArray = $this->toArray();
5383
5384
        \array_pop($tmpArray);
5385
5386
        return static::create(
5387
            $tmpArray,
5388
            $this->iteratorClass,
5389
            false
5390
        );
5391
    }
5392
5393
    /**
5394
     * Removes a particular value from an array (numeric or associative).
@@ 5664-5673 (lines=10) @@
5661
     * @psalm-return static<TKey,T>
5662
     * @psalm-mutation-free
5663
     */
5664
    public function rest(int $from = 1): self
5665
    {
5666
        $tmpArray = $this->toArray();
5667
5668
        return static::create(
5669
            \array_splice($tmpArray, $from),
5670
            $this->iteratorClass,
5671
            false
5672
        );
5673
    }
5674
5675
    /**
5676
     * Return the array in the reverse order.