Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2743-2748 (lines=6) @@
2740
            return static::create([], $this->iteratorClass, false);
2741
        }
2742
2743
        if ($number === null) {
2744
            /** @noinspection NonSecureArrayRandUsageInspection */
2745
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
2746
2747
            return static::create($arrayRandValue, $this->iteratorClass, false);
2748
        }
2749
2750
        $arrayTmp = $this->array;
2751
        /** @noinspection NonSecureShuffleUsageInspection */
@@ 2823-2829 (lines=7) @@
2820
            return static::create([], $this->iteratorClass, false);
2821
        }
2822
2823
        if ($number === null) {
2824
            /** @noinspection NonSecureArrayRandUsageInspection */
2825
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
2826
            $this->array = $arrayRandValue;
2827
2828
            return $this;
2829
        }
2830
2831
        /** @noinspection NonSecureShuffleUsageInspection */
2832
        \shuffle($this->array);