Code Duplication    Length = 17-17 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1764-1780 (lines=17) @@
1761
     * @return static
1762
     *                <p>(Immutable)</p>
1763
     */
1764
    public function firstsImmutable(int $number = null): self
1765
    {
1766
        $arrayTmp = $this->getArray();
1767
1768
        if ($number === null) {
1769
            $array = (array) \array_shift($arrayTmp);
1770
        } else {
1771
            $number = (int) $number;
1772
            $array = \array_splice($arrayTmp, 0, $number);
1773
        }
1774
1775
        return static::create(
1776
            $array,
1777
            $this->iteratorClass,
1778
            false
1779
        );
1780
    }
1781
1782
    /**
1783
     * Get the first value(s) from the current array.
@@ 1791-1807 (lines=17) @@
1788
     * @return static
1789
     *                <p>(Immutable)</p>
1790
     */
1791
    public function firstsKeys(int $number = null): self
1792
    {
1793
        $arrayTmp = $this->keys()->getArray();
1794
1795
        if ($number === null) {
1796
            $array = (array) \array_shift($arrayTmp);
1797
        } else {
1798
            $number = (int) $number;
1799
            $array = \array_splice($arrayTmp, 0, $number);
1800
        }
1801
1802
        return static::create(
1803
            $array,
1804
            $this->iteratorClass,
1805
            false
1806
        );
1807
    }
1808
1809
    /**
1810
     * Get and rmove the first value(s) from the current array.