Code Duplication    Length = 10-12 lines in 3 locations

src/Arrayy.php 3 locations

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