From b5c7820d9d14c04cc17228710bd135504a0046b9 Mon Sep 17 00:00:00 2001 From: Quazz Date: Tue, 7 Jun 2022 11:33:26 +0200 Subject: [PATCH] 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. --- Service/Anonymize/Anonymizer/Number.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Service/Anonymize/Anonymizer/Number.php b/Service/Anonymize/Anonymizer/Number.php index 83b5874..960cbf5 100644 --- a/Service/Anonymize/Anonymizer/Number.php +++ b/Service/Anonymize/Anonymizer/Number.php @@ -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; } /**