Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4233-4238 (lines=6) @@
4230
            );
4231
        }
4232
4233
        if ($number === null) {
4234
            /** @noinspection NonSecureArrayRandUsageInspection */
4235
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4236
4237
            return static::create(
4238
                $arrayRandValue,
4239
                $this->iteratorClass,
4240
                false
4241
            );
@@ 4337-4343 (lines=7) @@
4334
            );
4335
        }
4336
4337
        if ($number === null) {
4338
            /** @noinspection NonSecureArrayRandUsageInspection */
4339
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4340
            $this->array = $arrayRandValue;
4341
4342
            return $this;
4343
        }
4344
4345
        /** @noinspection NonSecureShuffleUsageInspection */
4346
        \shuffle($this->array);