Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 5496-5507 (lines=12) @@
5493
     * @phpstan-return static<TKey,T>
5494
     * @psalm-mutation-free
5495
     */
5496
    public function removeFirst(): self
5497
    {
5498
        $tmpArray = $this->toArray();
5499
5500
        \array_shift($tmpArray);
5501
5502
        return static::create(
5503
            $tmpArray,
5504
            $this->iteratorClass,
5505
            false
5506
        );
5507
    }
5508
5509
    /**
5510
     * Remove the last value from the current array.
@@ 5522-5533 (lines=12) @@
5519
     * @phpstan-return static<TKey,T>
5520
     * @psalm-mutation-free
5521
     */
5522
    public function removeLast(): self
5523
    {
5524
        $tmpArray = $this->toArray();
5525
5526
        \array_pop($tmpArray);
5527
5528
        return static::create(
5529
            $tmpArray,
5530
            $this->iteratorClass,
5531
            false
5532
        );
5533
    }
5534
5535
    /**
5536
     * Removes a particular value from an array (numeric or associative).
@@ 5821-5830 (lines=10) @@
5818
     * @phpstan-return static<TKey,T>
5819
     * @psalm-mutation-free
5820
     */
5821
    public function rest(int $from = 1): self
5822
    {
5823
        $tmpArray = $this->toArray();
5824
5825
        return static::create(
5826
            \array_splice($tmpArray, $from),
5827
            $this->iteratorClass,
5828
            false
5829
        );
5830
    }
5831
5832
    /**
5833
     * Return the array in the reverse order.