Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2662-2667 (lines=6) @@
2659
            return static::create([], $this->iteratorClass, false);
2660
        }
2661
2662
        if ($number === null) {
2663
            /** @noinspection NonSecureArrayRandUsageInspection */
2664
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
2665
2666
            return static::create($arrayRandValue, $this->iteratorClass, false);
2667
        }
2668
2669
        $arrayTmp = $this->array;
2670
        /** @noinspection NonSecureShuffleUsageInspection */
@@ 2738-2744 (lines=7) @@
2735
            return static::create([], $this->iteratorClass, false);
2736
        }
2737
2738
        if ($number === null) {
2739
            /** @noinspection NonSecureArrayRandUsageInspection */
2740
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
2741
            $this->array = $arrayRandValue;
2742
2743
            return $this;
2744
        }
2745
2746
        /** @noinspection NonSecureShuffleUsageInspection */
2747
        \shuffle($this->array);