Code Duplication    Length = 13-13 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1730-1742 (lines=13) @@
1727
     * @return static
1728
     *                <p>(Immutable)</p>
1729
     */
1730
    public function firstsImmutable(int $number = null)
1731
    {
1732
        if ($number === null) {
1733
            $arrayTmp = $this->array;
1734
            $array = (array) \array_shift($arrayTmp);
1735
        } else {
1736
            $number = (int) $number;
1737
            $arrayTmp = $this->array;
1738
            $array = \array_splice($arrayTmp, 0, $number);
1739
        }
1740
1741
        return static::create($array, $this->iteratorClass, false);
1742
    }
1743
1744
    /**
1745
     * Get the first value(s) from the current array.
@@ 3918-3930 (lines=13) @@
3915
     * @return static
3916
     *                <p>(Immutable)</p>
3917
     */
3918
    public function split(int $numberOfPieces = 2, bool $keepKeys = false)
3919
    {
3920
        $arrayCount = \count($this->array, \COUNT_NORMAL);
3921
3922
        if ($arrayCount === 0) {
3923
            $result = [];
3924
        } else {
3925
            $splitSize = (int) \ceil($arrayCount / $numberOfPieces);
3926
            $result = \array_chunk($this->array, $splitSize, $keepKeys);
3927
        }
3928
3929
        return static::create($result, $this->iteratorClass, false);
3930
    }
3931
3932
    /**
3933
     * Stripe all empty items.