Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4806-4811 (lines=6) @@
4803
            );
4804
        }
4805
4806
        if ($number === null) {
4807
            /** @noinspection NonSecureArrayRandUsageInspection */
4808
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4809
4810
            return static::create(
4811
                $arrayRandValue,
4812
                $this->iteratorClass,
4813
                false
4814
            );
@@ 4923-4929 (lines=7) @@
4920
            );
4921
        }
4922
4923
        if ($number === null) {
4924
            /** @noinspection NonSecureArrayRandUsageInspection */
4925
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4926
            $this->array = $arrayRandValue;
4927
4928
            return $this;
4929
        }
4930
4931
        /** @noinspection NonSecureShuffleUsageInspection */
4932
        \shuffle($this->array);