Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4497-4508 (lines=12) @@
4494
     * @psalm-return static<TKey,T>
4495
     * @psalm-mutation-free
4496
     */
4497
    public function removeFirst(): self
4498
    {
4499
        $tmpArray = $this->toArray();
4500
4501
        \array_shift($tmpArray);
4502
4503
        return static::create(
4504
            $tmpArray,
4505
            $this->iteratorClass,
4506
            false
4507
        );
4508
    }
4509
4510
    /**
4511
     * Remove the last value from the current array.
@@ 4519-4530 (lines=12) @@
4516
     * @psalm-return static<TKey,T>
4517
     * @psalm-mutation-free
4518
     */
4519
    public function removeLast(): self
4520
    {
4521
        $tmpArray = $this->toArray();
4522
4523
        \array_pop($tmpArray);
4524
4525
        return static::create(
4526
            $tmpArray,
4527
            $this->iteratorClass,
4528
            false
4529
        );
4530
    }
4531
4532
    /**
4533
     * Removes a particular value from an array (numeric or associative).
@@ 4746-4755 (lines=10) @@
4743
     * @psalm-return static<TKey,T>
4744
     * @psalm-mutation-free
4745
     */
4746
    public function rest(int $from = 1): self
4747
    {
4748
        $tmpArray = $this->toArray();
4749
4750
        return static::create(
4751
            \array_splice($tmpArray, $from),
4752
            $this->iteratorClass,
4753
            false
4754
        );
4755
    }
4756
4757
    /**
4758
     * Return the array in the reverse order.