Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2946-2951 (lines=6) @@
2943
            );
2944
        }
2945
2946
        if ($number === null) {
2947
            /** @noinspection NonSecureArrayRandUsageInspection */
2948
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
2949
2950
            return static::create(
2951
                $arrayRandValue,
2952
                $this->iteratorClass,
2953
                false
2954
            );
@@ 3042-3048 (lines=7) @@
3039
            );
3040
        }
3041
3042
        if ($number === null) {
3043
            /** @noinspection NonSecureArrayRandUsageInspection */
3044
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
3045
            $this->array = $arrayRandValue;
3046
3047
            return $this;
3048
        }
3049
3050
        /** @noinspection NonSecureShuffleUsageInspection */
3051
        \shuffle($this->array);