Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 5123-5128 (lines=6) @@
5120
            );
5121
        }
5122
5123
        if ($number === null) {
5124
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
5125
5126
            return static::create(
5127
                $arrayRandValue,
5128
                $this->iteratorClass,
5129
                false
5130
            );
5131
        }
@@ 5240-5246 (lines=7) @@
5237
            );
5238
        }
5239
5240
        if ($number === null) {
5241
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
5242
            $this->array = $arrayRandValue;
5243
5244
            return $this;
5245
        }
5246
5247
        \shuffle($this->array);
5248
5249
        return $this->firstsMutable($number);