Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

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