[x] uses the Helper to determine largest random number
Follows #754.
Running
git grep mt_getrandmax\(\)
on current 2.0 yields
src/Faker/Core/Number.php:63: return round($min + $this->numberBetween() / mt_getrandmax() * ($max - $min), $nbMaxDecimals);
src/Faker/Core/Number.php:73: if ($max > mt_getrandmax()) {
src/Faker/Core/Number.php:74: throw new \InvalidArgumentException('randomNumber() can only generate numbers up to mt_getrandmax()');
src/Faker/Extension/Helper.php:45: $maxAtOnce = strlen((string) mt_getrandmax()) - 1;
src/Faker/Extension/NumberExtension.php:45: * The maximum value returned is mt_getrandmax()
src/Faker/Generator.php:903: * The maximum value returned is mt_getrandmax()
src/Faker/Provider/Base.php:68: * The maximum value returned is mt_getrandmax()
src/Faker/Provider/Base.php:88: if ($max > mt_getrandmax()) {
src/Faker/Provider/Base.php:89: throw new \InvalidArgumentException('randomNumber() can only generate numbers up to mt_getrandmax()');
src/Faker/Provider/Base.php:130: return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $nbMaxDecimals);
src/Faker/Provider/Base.php:452: $maxAtOnce = strlen((string) mt_getrandmax()) - 1;
src/Faker/Provider/Base.php:645: if ($weight > 0 && $weight < 1 && mt_rand() / mt_getrandmax() <= $weight) {
src/Faker/Provider/Biased.php:26: $x = mt_rand() / mt_getrandmax();
src/Faker/Provider/Biased.php:27: $y = mt_rand() / (mt_getrandmax() + 1);
src/Faker/Provider/bg_BG/Payment.php:42: self::randomNumber(5, true), // workaround for mt_getrandmax() limitation
What is the reason for this PR?
Helper
to determine largest random numberFollows #754.
Running
on current
2.0
yieldsAuthor's checklist
Summary of changes
Review checklist
CHANGELOG.md