From a7dc2854766f738cc1be261306356d619b40003f Mon Sep 17 00:00:00 2001 From: Yurii Savka Date: Tue, 2 Feb 2016 21:28:01 +0100 Subject: [PATCH] Use generator to populate numbers. --- src/Faker/ORM/Spot/ColumnTypeGuesser.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Faker/ORM/Spot/ColumnTypeGuesser.php b/src/Faker/ORM/Spot/ColumnTypeGuesser.php index 59f574a7ce..716a9f282e 100644 --- a/src/Faker/ORM/Spot/ColumnTypeGuesser.php +++ b/src/Faker/ORM/Spot/ColumnTypeGuesser.php @@ -38,20 +38,20 @@ public function guessFormat(array $field) return $generator->randomNumber($size + 2) / 100; }; case 'smallint': - return function () { - return mt_rand(0, 65535); + return function () use ($generator) { + return $generator->numberBetween(0, 65535); }; case 'integer': - return function () { - return mt_rand(0, intval('2147483647')); + return function () use ($generator) { + return $generator->numberBetween(0, intval('2147483647')); }; case 'bigint': - return function () { - return mt_rand(0, intval('18446744073709551615')); + return function () use ($generator) { + return $generator->numberBetween(0, intval('18446744073709551615')); }; case 'float': - return function () { - return mt_rand(0, intval('4294967295'))/mt_rand(1, intval('4294967295')); + return function () use ($generator) { + return $generator->randomFloat(null, 0, intval('4294967295')); }; case 'string': $size = isset($field['length']) ? $field['length'] : 255;