Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4977-4982 (lines=6) @@
4974
            );
4975
        }
4976
4977
        if ($number === null) {
4978
            /** @noinspection NonSecureArrayRandUsageInspection */
4979
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4980
4981
            return static::create(
4982
                $arrayRandValue,
4983
                $this->iteratorClass,
4984
                false
4985
            );
@@ 5094-5100 (lines=7) @@
5091
            );
5092
        }
5093
5094
        if ($number === null) {
5095
            /** @noinspection NonSecureArrayRandUsageInspection */
5096
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
5097
            $this->array = $arrayRandValue;
5098
5099
            return $this;
5100
        }
5101
5102
        /** @noinspection NonSecureShuffleUsageInspection */
5103
        \shuffle($this->array);