Code Duplication    Length = 6-7 lines in 2 locations

src/Arrayy.php 2 locations

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