Aggiornato Composer
This commit is contained in:
40
vendor/fakerphp/faker/src/Faker/Generator.php
vendored
40
vendor/fakerphp/faker/src/Faker/Generator.php
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Faker;
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Faker\Container\ContainerInterface;
|
||||
|
||||
/**
|
||||
* @property string $citySuffix
|
||||
@@ -255,7 +255,7 @@ use Psr\Container\ContainerInterface;
|
||||
*
|
||||
* @property string $timezone
|
||||
*
|
||||
* @method string timezone()
|
||||
* @method string timezone($countryCode = null)
|
||||
*
|
||||
* @property void $setDefaultTimezone
|
||||
*
|
||||
@@ -275,11 +275,11 @@ use Psr\Container\ContainerInterface;
|
||||
*
|
||||
* @property string $imageUrl
|
||||
*
|
||||
* @method string imageUrl($width = 640, $height = 480, $category = null, $randomize = true, $word = null, $gray = false)
|
||||
* @method string imageUrl($width = 640, $height = 480, $category = null, $randomize = true, $word = null, $gray = false, string $format = 'png')
|
||||
*
|
||||
* @property string $image
|
||||
*
|
||||
* @method string image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null, $gray = false)
|
||||
* @method string image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null, $gray = false, string $format = 'png')
|
||||
*
|
||||
* @property string $email
|
||||
*
|
||||
@@ -463,7 +463,7 @@ use Psr\Container\ContainerInterface;
|
||||
*
|
||||
* @property string $lastName
|
||||
*
|
||||
* @method string lastName()
|
||||
* @method string lastName($gender = null)
|
||||
*
|
||||
* @property string $title
|
||||
*
|
||||
@@ -513,6 +513,10 @@ use Psr\Container\ContainerInterface;
|
||||
*
|
||||
* @method string chrome()
|
||||
*
|
||||
* @property string $msedge
|
||||
*
|
||||
* @method string msedge()
|
||||
*
|
||||
* @property string $firefox
|
||||
*
|
||||
* @method string firefox()
|
||||
@@ -537,6 +541,10 @@ use Psr\Container\ContainerInterface;
|
||||
*
|
||||
* @method string macPlatformToken()
|
||||
*
|
||||
* @property string $iosMobileToken
|
||||
*
|
||||
* @method string iosMobileToken()
|
||||
*
|
||||
* @property string $linuxPlatformToken
|
||||
*
|
||||
* @method string linuxPlatformToken()
|
||||
@@ -559,7 +567,7 @@ class Generator
|
||||
|
||||
public function __construct(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container ?: Extension\ContainerBuilder::getDefault();
|
||||
$this->container = $container ?: Container\ContainerBuilder::withDefaultExtensions()->build();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -576,7 +584,7 @@ class Generator
|
||||
if (!$this->container->has($id)) {
|
||||
throw new Extension\ExtensionNotFound(sprintf(
|
||||
'No Faker extension with id "%s" was loaded.',
|
||||
$id
|
||||
$id,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -679,10 +687,22 @@ class Generator
|
||||
if ($seed === null) {
|
||||
mt_srand();
|
||||
} else {
|
||||
mt_srand((int) $seed, MT_RAND_PHP);
|
||||
mt_srand((int) $seed, self::mode());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://www.php.net/manual/en/migration83.deprecated.php#migration83.deprecated.random
|
||||
*/
|
||||
private static function mode(): int
|
||||
{
|
||||
if (PHP_VERSION_ID < 80300) {
|
||||
return MT_RAND_PHP;
|
||||
}
|
||||
|
||||
return MT_RAND_MT19937;
|
||||
}
|
||||
|
||||
public function format($format, $arguments = [])
|
||||
{
|
||||
return call_user_func_array($this->getFormatter($format), $arguments);
|
||||
@@ -885,7 +905,7 @@ class Generator
|
||||
return $this->ext(Extension\NumberExtension::class)->randomFloat(
|
||||
$nbMaxDecimals !== null ? (int) $nbMaxDecimals : null,
|
||||
(float) $min,
|
||||
$max !== null ? (float) $max : null
|
||||
$max !== null ? (float) $max : null,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -903,7 +923,7 @@ class Generator
|
||||
{
|
||||
return $this->ext(Extension\NumberExtension::class)->randomNumber(
|
||||
$nbDigits !== null ? (int) $nbDigits : null,
|
||||
(bool) $strict
|
||||
(bool) $strict,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user