Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4129-4134 (lines=6) @@
4126
            );
4127
        }
4128
4129
        if ($number === null) {
4130
            /** @noinspection NonSecureArrayRandUsageInspection */
4131
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4132
4133
            return static::create(
4134
                $arrayRandValue,
4135
                $this->iteratorClass,
4136
                false
4137
            );
@@ 4233-4239 (lines=7) @@
4230
            );
4231
        }
4232
4233
        if ($number === null) {
4234
            /** @noinspection NonSecureArrayRandUsageInspection */
4235
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4236
            $this->array = $arrayRandValue;
4237
4238
            return $this;
4239
        }
4240
4241
        /** @noinspection NonSecureShuffleUsageInspection */
4242
        \shuffle($this->array);