Code Duplication    Length = 17-17 lines in 2 locations

src/Arrayy.php 2 locations

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