Code Duplication    Length = 17-17 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1836-1852 (lines=17) @@
1833
     * @return static
1834
     *                <p>(Immutable)</p>
1835
     */
1836
    public function firstsKeys(int $number = null): self
1837
    {
1838
        $arrayTmp = $this->keys()->getArray();
1839
1840
        if ($number === null) {
1841
            $array = (array) \array_shift($arrayTmp);
1842
        } else {
1843
            $number = (int) $number;
1844
            $array = \array_splice($arrayTmp, 0, $number);
1845
        }
1846
1847
        return static::create(
1848
            $array,
1849
            $this->iteratorClass,
1850
            false
1851
        );
1852
    }
1853
1854
    /**
1855
     * Get the first value(s) from the current array.
@@ 1863-1879 (lines=17) @@
1860
     * @return static
1861
     *                <p>(Immutable)</p>
1862
     */
1863
    public function firstsImmutable(int $number = null): self
1864
    {
1865
        $arrayTmp = $this->getArray();
1866
1867
        if ($number === null) {
1868
            $array = (array) \array_shift($arrayTmp);
1869
        } else {
1870
            $number = (int) $number;
1871
            $array = \array_splice($arrayTmp, 0, $number);
1872
        }
1873
1874
        return static::create(
1875
            $array,
1876
            $this->iteratorClass,
1877
            false
1878
        );
1879
    }
1880
1881
    /**
1882
     * Get and rmove the first value(s) from the current array.