Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

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