Code Duplication    Length = 17-17 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1746-1762 (lines=17) @@
1743
     * @return static
1744
     *                <p>(Immutable)</p>
1745
     */
1746
    public function firstsKeys(int $number = null): self
1747
    {
1748
        $arrayTmp = $this->keys()->getArray();
1749
1750
        if ($number === null) {
1751
            $array = (array) \array_shift($arrayTmp);
1752
        } else {
1753
            $number = (int) $number;
1754
            $array = \array_splice($arrayTmp, 0, $number);
1755
        }
1756
1757
        return static::create(
1758
            $array,
1759
            $this->iteratorClass,
1760
            false
1761
        );
1762
    }
1763
1764
    /**
1765
     * Get the first value(s) from the current array.
@@ 1773-1789 (lines=17) @@
1770
     * @return static
1771
     *                <p>(Immutable)</p>
1772
     */
1773
    public function firstsImmutable(int $number = null): self
1774
    {
1775
        $arrayTmp = $this->getArray();
1776
1777
        if ($number === null) {
1778
            $array = (array) \array_shift($arrayTmp);
1779
        } else {
1780
            $number = (int) $number;
1781
            $array = \array_splice($arrayTmp, 0, $number);
1782
        }
1783
1784
        return static::create(
1785
            $array,
1786
            $this->iteratorClass,
1787
            false
1788
        );
1789
    }
1790
1791
    /**
1792
     * Get and rmove the first value(s) from the current array.