Code Duplication    Length = 17-17 lines in 2 locations

src/Arrayy.php 2 locations

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