Code Duplication    Length = 17-17 lines in 2 locations

src/Arrayy.php 2 locations

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