Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4309-4314 (lines=6) @@
4306
            );
4307
        }
4308
4309
        if ($number === null) {
4310
            /** @noinspection NonSecureArrayRandUsageInspection */
4311
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4312
4313
            return static::create(
4314
                $arrayRandValue,
4315
                $this->iteratorClass,
4316
                false
4317
            );
@@ 4413-4419 (lines=7) @@
4410
            );
4411
        }
4412
4413
        if ($number === null) {
4414
            /** @noinspection NonSecureArrayRandUsageInspection */
4415
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4416
            $this->array = $arrayRandValue;
4417
4418
            return $this;
4419
        }
4420
4421
        /** @noinspection NonSecureShuffleUsageInspection */
4422
        \shuffle($this->array);