Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 3068-3073 (lines=6) @@
3065
            return static::create([], $this->iteratorClass, false);
3066
        }
3067
3068
        if ($number === null) {
3069
            /** @noinspection NonSecureArrayRandUsageInspection */
3070
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
3071
3072
            return static::create($arrayRandValue, $this->iteratorClass, false);
3073
        }
3074
3075
        $arrayTmp = $this->array;
3076
        /** @noinspection NonSecureShuffleUsageInspection */
@@ 3144-3150 (lines=7) @@
3141
            return static::create([], $this->iteratorClass, false);
3142
        }
3143
3144
        if ($number === null) {
3145
            /** @noinspection NonSecureArrayRandUsageInspection */
3146
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
3147
            $this->array = $arrayRandValue;
3148
3149
            return $this;
3150
        }
3151
3152
        /** @noinspection NonSecureShuffleUsageInspection */
3153
        \shuffle($this->array);