Skip to content

Commit b5c7820

Browse files
authored
Prevent errors in getRandomNumber call on 2.4.4
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.
1 parent b9c5f58 commit b5c7820

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Service/Anonymize/Anonymizer/Number.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function __construct(
2929
?int $min = null,
3030
?int $max = null
3131
) {
32-
$this->min = $min !== null && $min < PHP_INT_MIN ? PHP_INT_MIN : $min;
33-
$this->max = $max !== null && $max < PHP_INT_MAX ? PHP_INT_MAX : $max;
32+
$this->min = $min < PHP_INT_MIN ? PHP_INT_MIN : $min;
33+
$this->max = $max !== null && $max > PHP_INT_MAX ? PHP_INT_MAX : $max;
3434
}
3535

3636
/**

0 commit comments

Comments
 (0)