Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2981-2986 (lines=6) @@
2978
            );
2979
        }
2980
2981
        if ($number === null) {
2982
            /** @noinspection NonSecureArrayRandUsageInspection */
2983
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
2984
2985
            return static::create(
2986
                $arrayRandValue,
2987
                $this->iteratorClass,
2988
                false
2989
            );
@@ 3077-3083 (lines=7) @@
3074
            );
3075
        }
3076
3077
        if ($number === null) {
3078
            /** @noinspection NonSecureArrayRandUsageInspection */
3079
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
3080
            $this->array = $arrayRandValue;
3081
3082
            return $this;
3083
        }
3084
3085
        /** @noinspection NonSecureShuffleUsageInspection */
3086
        \shuffle($this->array);