Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2868-2873 (lines=6) @@
2865
            );
2866
        }
2867
2868
        if ($number === null) {
2869
            /** @noinspection NonSecureArrayRandUsageInspection */
2870
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
2871
2872
            return static::create(
2873
                $arrayRandValue,
2874
                $this->iteratorClass,
2875
                false
2876
            );
@@ 2964-2970 (lines=7) @@
2961
            );
2962
        }
2963
2964
        if ($number === null) {
2965
            /** @noinspection NonSecureArrayRandUsageInspection */
2966
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
2967
            $this->array = $arrayRandValue;
2968
2969
            return $this;
2970
        }
2971
2972
        /** @noinspection NonSecureShuffleUsageInspection */
2973
        \shuffle($this->array);