Code Duplication    Length = 17-17 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1804-1820 (lines=17) @@
1801
     * @return static
1802
     *                <p>(Immutable)</p>
1803
     */
1804
    public function firstsKeys(int $number = null): self
1805
    {
1806
        $arrayTmp = $this->keys()->getArray();
1807
1808
        if ($number === null) {
1809
            $array = (array) \array_shift($arrayTmp);
1810
        } else {
1811
            $number = (int) $number;
1812
            $array = \array_splice($arrayTmp, 0, $number);
1813
        }
1814
1815
        return static::create(
1816
            $array,
1817
            $this->iteratorClass,
1818
            false
1819
        );
1820
    }
1821
1822
    /**
1823
     * Get the first value(s) from the current array.
@@ 1831-1847 (lines=17) @@
1828
     * @return static
1829
     *                <p>(Immutable)</p>
1830
     */
1831
    public function firstsImmutable(int $number = null): self
1832
    {
1833
        $arrayTmp = $this->getArray();
1834
1835
        if ($number === null) {
1836
            $array = (array) \array_shift($arrayTmp);
1837
        } else {
1838
            $number = (int) $number;
1839
            $array = \array_splice($arrayTmp, 0, $number);
1840
        }
1841
1842
        return static::create(
1843
            $array,
1844
            $this->iteratorClass,
1845
            false
1846
        );
1847
    }
1848
1849
    /**
1850
     * Get and rmove the first value(s) from the current array.