Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2965-2970 (lines=6) @@
2962
      return static::create([], $this->iteratorClass, false);
2963
    }
2964
2965
    if ($number === null) {
2966
      /** @noinspection NonSecureArrayRandUsageInspection */
2967
      $arrayRandValue = [$this->array[\array_rand($this->array)]];
2968
2969
      return static::create($arrayRandValue, $this->iteratorClass, false);
2970
    }
2971
2972
    $arrayTmp = $this->array;
2973
    /** @noinspection NonSecureShuffleUsageInspection */
@@ 3038-3044 (lines=7) @@
3035
      return static::create([], $this->iteratorClass, false);
3036
    }
3037
3038
    if ($number === null) {
3039
      /** @noinspection NonSecureArrayRandUsageInspection */
3040
      $arrayRandValue = [$this->array[\array_rand($this->array)]];
3041
      $this->array = $arrayRandValue;
3042
3043
      return $this;
3044
    }
3045
3046
    /** @noinspection NonSecureShuffleUsageInspection */
3047
    \shuffle($this->array);