Code Duplication    Length = 17-17 lines in 2 locations

src/Arrayy.php 2 locations

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