Skip to content

Commit

Permalink
Prevent errors in getRandomNumber call on 2.4.4
Browse files Browse the repository at this point in the history
It is now mandatory to pass an integer to the function; otherwise an error is thrown.

Currently if min is defined as null it will be passed as null, throwing an error.

Max is allowed to be null, however.
  • Loading branch information
Quazz authored Jun 7, 2022
1 parent b9c5f58 commit b5c7820
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Service/Anonymize/Anonymizer/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public function __construct(
?int $min = null,
?int $max = null
) {
$this->min = $min !== null && $min < PHP_INT_MIN ? PHP_INT_MIN : $min;
$this->max = $max !== null && $max < PHP_INT_MAX ? PHP_INT_MAX : $max;
$this->min = $min < PHP_INT_MIN ? PHP_INT_MIN : $min;
$this->max = $max !== null && $max > PHP_INT_MAX ? PHP_INT_MAX : $max;
}

/**
Expand Down

0 comments on commit b5c7820

Please sign in to comment.