Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 3510-3515 (lines=6) @@
3507
            );
3508
        }
3509
3510
        if ($number === null) {
3511
            /** @noinspection NonSecureArrayRandUsageInspection */
3512
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
3513
3514
            return static::create(
3515
                $arrayRandValue,
3516
                $this->iteratorClass,
3517
                false
3518
            );
@@ 3610-3616 (lines=7) @@
3607
            );
3608
        }
3609
3610
        if ($number === null) {
3611
            /** @noinspection NonSecureArrayRandUsageInspection */
3612
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
3613
            $this->array = $arrayRandValue;
3614
3615
            return $this;
3616
        }
3617
3618
        /** @noinspection NonSecureShuffleUsageInspection */
3619
        \shuffle($this->array);