Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4482-4487 (lines=6) @@
4479
            );
4480
        }
4481
4482
        if ($number === null) {
4483
            /** @noinspection NonSecureArrayRandUsageInspection */
4484
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4485
4486
            return static::create(
4487
                $arrayRandValue,
4488
                $this->iteratorClass,
4489
                false
4490
            );
@@ 4586-4592 (lines=7) @@
4583
            );
4584
        }
4585
4586
        if ($number === null) {
4587
            /** @noinspection NonSecureArrayRandUsageInspection */
4588
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
4589
            $this->array = $arrayRandValue;
4590
4591
            return $this;
4592
        }
4593
4594
        /** @noinspection NonSecureShuffleUsageInspection */
4595
        \shuffle($this->array);