Skip to content

Commit

Permalink
update code for PHP 8 - fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 4, 2022
1 parent 8ef4a6b commit 8c18ff4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/MersenneTwisterRNGIteratorAggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function getIterator(): Generator

// @phpstan-ignore-next-line
while (true) {
yield random_int($this->min, $this->max);
yield mt_rand($this->min, $this->max);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/RandomIterableAggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private function randomize(iterable $iterable, int $seed): Generator
$queue = [];

foreach (new UnpackIterableAggregate($iterable) as $key => $value) {
if (0 === random_int(0, $seed)) {
if (0 === mt_rand(0, $seed)) {
yield $key => $value;

continue;
Expand Down

0 comments on commit 8c18ff4

Please sign in to comment.