Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 3158-3163 (lines=6) @@
3155
            );
3156
        }
3157
3158
        if ($number === null) {
3159
            /** @noinspection NonSecureArrayRandUsageInspection */
3160
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
3161
3162
            return static::create(
3163
                $arrayRandValue,
3164
                $this->iteratorClass,
3165
                false
3166
            );
@@ 3254-3260 (lines=7) @@
3251
            );
3252
        }
3253
3254
        if ($number === null) {
3255
            /** @noinspection NonSecureArrayRandUsageInspection */
3256
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
3257
            $this->array = $arrayRandValue;
3258
3259
            return $this;
3260
        }
3261
3262
        /** @noinspection NonSecureShuffleUsageInspection */
3263
        \shuffle($this->array);