Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 5488-5499 (lines=12) @@
5485
     * @phpstan-return static<TKey,T>
5486
     * @psalm-mutation-free
5487
     */
5488
    public function removeFirst(): self
5489
    {
5490
        $tmpArray = $this->toArray();
5491
5492
        \array_shift($tmpArray);
5493
5494
        return static::create(
5495
            $tmpArray,
5496
            $this->iteratorClass,
5497
            false
5498
        );
5499
    }
5500
5501
    /**
5502
     * Remove the last value from the current array.
@@ 5514-5525 (lines=12) @@
5511
     * @phpstan-return static<TKey,T>
5512
     * @psalm-mutation-free
5513
     */
5514
    public function removeLast(): self
5515
    {
5516
        $tmpArray = $this->toArray();
5517
5518
        \array_pop($tmpArray);
5519
5520
        return static::create(
5521
            $tmpArray,
5522
            $this->iteratorClass,
5523
            false
5524
        );
5525
    }
5526
5527
    /**
5528
     * Removes a particular value from an array (numeric or associative).
@@ 5813-5822 (lines=10) @@
5810
     * @phpstan-return static<TKey,T>
5811
     * @psalm-mutation-free
5812
     */
5813
    public function rest(int $from = 1): self
5814
    {
5815
        $tmpArray = $this->toArray();
5816
5817
        return static::create(
5818
            \array_splice($tmpArray, $from),
5819
            $this->iteratorClass,
5820
            false
5821
        );
5822
    }
5823
5824
    /**
5825
     * Return the array in the reverse order.