Code Duplication    Length = 17-17 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1755-1771 (lines=17) @@
1752
     * @return static
1753
     *                <p>(Immutable)</p>
1754
     */
1755
    public function firstsImmutable(int $number = null): self
1756
    {
1757
        $arrayTmp = $this->getArray();
1758
1759
        if ($number === null) {
1760
            $array = (array) \array_shift($arrayTmp);
1761
        } else {
1762
            $number = (int) $number;
1763
            $array = \array_splice($arrayTmp, 0, $number);
1764
        }
1765
1766
        return static::create(
1767
            $array,
1768
            $this->iteratorClass,
1769
            false
1770
        );
1771
    }
1772
1773
    /**
1774
     * Get the first value(s) from the current array.
@@ 1782-1798 (lines=17) @@
1779
     * @return static
1780
     *                <p>(Immutable)</p>
1781
     */
1782
    public function firstsKeys(int $number = null): self
1783
    {
1784
        $arrayTmp = $this->keys()->getArray();
1785
1786
        if ($number === null) {
1787
            $array = (array) \array_shift($arrayTmp);
1788
        } else {
1789
            $number = (int) $number;
1790
            $array = \array_splice($arrayTmp, 0, $number);
1791
        }
1792
1793
        return static::create(
1794
            $array,
1795
            $this->iteratorClass,
1796
            false
1797
        );
1798
    }
1799
1800
    /**
1801
     * Get and rmove the first value(s) from the current array.