Skip to content

Commit

Permalink
fix: Propagate the call to mt_rand() by assigning it to $seed (Fixes #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
pointybeard committed Nov 27, 2020
1 parent 2d93f78 commit 0daf00a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ReverseRegex/Random/SimpleRandom.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class SimpleRandom implements GeneratorInterface
public function __construct($seed = null)
{
if ($seed === null || $seed === 0) {
$this->seed(mt_rand());
## 6 - Propagate the call to mt_rand() by assigning it to $seed
$seed = mt_rand();
}

$this->seed($seed);
Expand Down Expand Up @@ -117,4 +118,4 @@ public function generate($min = 0, $max = null)
}

}
/* End of File */
/* End of File */

0 comments on commit 0daf00a

Please sign in to comment.