diff --git a/.appveyor.yml b/.appveyor.yml
index b4070c4e79..507bc46e0e 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -26,6 +26,8 @@ install:
- echo memory_limit=-1 >> php.ini-min
- echo serialize_precision=-1 >> php.ini-min
- echo max_execution_time=1200 >> php.ini-min
+ - echo post_max_size=4G >> php.ini-min
+ - echo upload_max_filesize=4G >> php.ini-min
- echo date.timezone="America/Los_Angeles" >> php.ini-min
- echo extension_dir=ext >> php.ini-min
- echo extension=php_xsl.dll >> php.ini-min
diff --git a/.php_cs.dist b/.php_cs.dist
index 537bd11d34..1221b062f1 100644
--- a/.php_cs.dist
+++ b/.php_cs.dist
@@ -11,8 +11,6 @@ return PhpCsFixer\Config::create()
'@Symfony' => true,
'@Symfony:risky' => true,
'protected_to_private' => false,
- 'native_constant_invocation' => true,
- 'list_syntax' => ['syntax' => 'short'],
])
->setRiskyAllowed(true)
->setFinder(
diff --git a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php
index b49b373444..1763631d61 100644
--- a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php
+++ b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php
@@ -62,7 +62,10 @@ class EntityUserProvider implements UserProviderInterface, PasswordUpgraderInter
}
if (null === $user) {
- throw new UsernameNotFoundException(sprintf('User "%s" not found.', $username));
+ $e = new UsernameNotFoundException(sprintf('User "%s" not found.', $username));
+ $e->setUsername($username);
+
+ throw $e;
}
return $user;
@@ -92,7 +95,10 @@ class EntityUserProvider implements UserProviderInterface, PasswordUpgraderInter
$refreshedUser = $repository->find($id);
if (null === $refreshedUser) {
- throw new UsernameNotFoundException('User with id '.json_encode($id).' not found.');
+ $e = new UsernameNotFoundException('User with id '.json_encode($id).' not found.');
+ $e->setUsername(json_encode($id));
+
+ throw $e;
}
}
diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
index 7822364abd..6b46d120ea 100644
--- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
+++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
@@ -95,12 +95,12 @@ $passthruOrFail = function ($command) {
if (\PHP_VERSION_ID >= 80000) {
// PHP 8 requires PHPUnit 9.3+
- $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '9.4');
+ $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '9.4') ?: '9.4';
} elseif (\PHP_VERSION_ID >= 70200) {
// PHPUnit 8 requires PHP 7.2+
- $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '8.5');
+ $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '8.5') ?: '8.5';
} else {
- $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '7.5');
+ $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '7.5') ?: '7.5';
}
$MAX_PHPUNIT_VERSION = $getEnvVar('SYMFONY_MAX_PHPUNIT_VERSION', false);
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/SecuredPageBundle/Security/Core/User/ArrayUserProvider.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/SecuredPageBundle/Security/Core/User/ArrayUserProvider.php
index d4e80836f8..4be162d871 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/SecuredPageBundle/Security/Core/User/ArrayUserProvider.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/SecuredPageBundle/Security/Core/User/ArrayUserProvider.php
@@ -34,7 +34,10 @@ class ArrayUserProvider implements UserProviderInterface
$user = $this->getUser($username);
if (null === $user) {
- throw new UsernameNotFoundException(sprintf('User "%s" not found.', $username));
+ $e = new UsernameNotFoundException(sprintf('User "%s" not found.', $username));
+ $e->setUsername($username);
+
+ throw $e;
}
return $user;
diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
index f3091bd9ce..ccdf3af67b 100644
--- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
@@ -904,7 +904,7 @@ EOF;
$factoryCode = $asFile ? 'self::do($container, false)' : sprintf('$this->%s(false)', $methodName);
$factoryCode = $this->getProxyDumper()->getProxyFactoryCode($definition, $id, $factoryCode);
- $code .= $asFile ? preg_replace('/function \(([^)]*+)\) {/', 'function (\1) use ($container) {', $factoryCode) : $factoryCode;
+ $code .= $asFile ? preg_replace('/function \(([^)]*+)\)( {|:)/', 'function (\1) use ($container)\2', $factoryCode) : $factoryCode;
}
$c = $this->addServiceInclude($id, $definition);
@@ -934,8 +934,7 @@ EOF;
if ($asFile) {
$code = str_replace('$this', '$container', $code);
- $code = str_replace('function () {', 'function () use ($container) {', $code);
- $code = str_replace('function ($lazyLoad = true) {', 'function ($lazyLoad = true) use ($container) {', $code);
+ $code = preg_replace('/function \(([^)]*+)\)( {|:)/', 'function (\1) use ($container)\2', $code);
}
$code .= " }\n";
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php
index ce1395773b..2e992fbc75 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php
@@ -244,6 +244,26 @@ class PhpDumperTest extends TestCase
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/php/services9_as_files.txt', $dump);
}
+ public function testDumpAsFilesWithTypedReference()
+ {
+ $container = include self::$fixturesPath.'/containers/container10.php';
+ $container->getDefinition('foo')->addTag('hot');
+ $container->register('bar', 'stdClass');
+ $container->register('closure', 'stdClass')
+ ->setProperty('closures', [
+ new ServiceClosureArgument(new TypedReference('foo', \stdClass::class, $container::IGNORE_ON_UNINITIALIZED_REFERENCE)),
+ ])
+ ->setPublic(true);
+ $container->compile();
+ $dumper = new PhpDumper($container);
+ $dump = print_r($dumper->dump(['as_files' => true, 'file' => __DIR__, 'hot_path_tag' => 'hot', 'inline_factories_parameter' => false, 'inline_class_loader_parameter' => false]), true);
+ if ('\\' === \DIRECTORY_SEPARATOR) {
+ $dump = str_replace("'.\\DIRECTORY_SEPARATOR.'", '/', $dump);
+ }
+
+ $this->assertStringMatchesFormatFile(self::$fixturesPath.'/php/services10_as_files.txt', $dump);
+ }
+
public function testDumpAsFilesWithFactoriesInlined()
{
$container = include self::$fixturesPath.'/containers/container9.php';
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10_as_files.txt b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10_as_files.txt
new file mode 100644
index 0000000000..ee674249b6
--- /dev/null
+++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10_as_files.txt
@@ -0,0 +1,167 @@
+Array
+(
+ [Container%s/removed-ids.php] => true,
+ 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
+ 'bar' => true,
+];
+
+ [Container%s/getClosureService.php] => services['closure'] = $instance = new \stdClass();
+
+ $instance->closures = [0 => function () use ($container): ?\stdClass {
+ return ($container->services['foo'] ?? null);
+ }];
+
+ return $instance;
+ }
+}
+
+ [Container%s/ProjectServiceContainer.php] => buildParameters = $buildParameters;
+ $this->containerDir = $containerDir;
+ $this->targetDir = \dirname($containerDir);
+ $this->services = $this->privates = [];
+ $this->methodMap = [
+ 'foo' => 'getFooService',
+ ];
+ $this->fileMap = [
+ 'closure' => 'getClosureService',
+ ];
+
+ $this->aliases = [];
+ }
+
+ public function compile(): void
+ {
+ throw new LogicException('You cannot compile a dumped container that was already compiled.');
+ }
+
+ public function isCompiled(): bool
+ {
+ return true;
+ }
+
+ public function getRemovedIds(): array
+ {
+ return require $this->containerDir.\DIRECTORY_SEPARATOR.'removed-ids.php';
+ }
+
+ protected function load($file, $lazyLoad = true)
+ {
+ if (class_exists($class = __NAMESPACE__.'\\'.$file, false)) {
+ return $class::do($this, $lazyLoad);
+ }
+
+ if ('.' === $file[-4]) {
+ $class = substr($class, 0, -4);
+ } else {
+ $file .= '.php';
+ }
+
+ $service = require $this->containerDir.\DIRECTORY_SEPARATOR.$file;
+
+ return class_exists($class, false) ? $class::do($this, $lazyLoad) : $service;
+ }
+
+ /**
+ * Gets the public 'foo' shared service.
+ *
+ * @return \FooClass
+ */
+ protected function getFooService()
+ {
+ return $this->services['foo'] = new \FooClass(new \stdClass());
+ }
+}
+
+ [ProjectServiceContainer.preload.php] => = 7.4 when preloading is desired
+
+use Symfony\Component\DependencyInjection\Dumper\Preloader;
+
+if (in_array(PHP_SAPI, ['cli', 'phpdbg'], true)) {
+ return;
+}
+
+require dirname(__DIR__, %d).'%svendor/autoload.php';
+require __DIR__.'/Container%s/ProjectServiceContainer.php';
+require __DIR__.'/Container%s/getClosureService.php';
+
+$classes = [];
+$classes[] = 'FooClass';
+$classes[] = 'Symfony\Component\DependencyInjection\ContainerInterface';
+
+Preloader::preload($classes);
+
+ [ProjectServiceContainer.php] => '%s',
+ 'container.build_id' => '%s',
+ 'container.build_time' => %d,
+], __DIR__.\DIRECTORY_SEPARATOR.'Container%s');
+
+)
diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FileType.php b/src/Symfony/Component/Form/Extension/Core/Type/FileType.php
index 391a425ddd..c79d301502 100644
--- a/src/Symfony/Component/Form/Extension/Core/Type/FileType.php
+++ b/src/Symfony/Component/Form/Extension/Core/Type/FileType.php
@@ -176,8 +176,10 @@ class FileType extends AbstractType
* Returns the maximum size of an uploaded file as configured in php.ini.
*
* This method should be kept in sync with Symfony\Component\HttpFoundation\File\UploadedFile::getMaxFilesize().
+ *
+ * @return int|float The maximum size of an uploaded file in bytes (returns float if size > PHP_INT_MAX)
*/
- private static function getMaxFilesize(): int
+ private static function getMaxFilesize()
{
$iniMax = strtolower(ini_get('upload_max_filesize'));
@@ -212,8 +214,10 @@ class FileType extends AbstractType
* (i.e. try "MB", then "kB", then "bytes").
*
* This method should be kept in sync with Symfony\Component\Validator\Constraints\FileValidator::factorizeSizes().
+ *
+ * @param int|float $limit
*/
- private function factorizeSizes(int $size, int $limit)
+ private function factorizeSizes(int $size, $limit)
{
$coef = self::MIB_BYTES;
$coefFactor = self::KIB_BYTES;
diff --git a/src/Symfony/Component/HttpClient/CurlHttpClient.php b/src/Symfony/Component/HttpClient/CurlHttpClient.php
index f5fc0e70e6..48ecf773d4 100644
--- a/src/Symfony/Component/HttpClient/CurlHttpClient.php
+++ b/src/Symfony/Component/HttpClient/CurlHttpClient.php
@@ -173,7 +173,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface,
$curlopts[\CURLOPT_DNS_USE_GLOBAL_CACHE] = false;
}
- if (\defined('CURLOPT_HEADEROPT')) {
+ if (\defined('CURLOPT_HEADEROPT') && \defined('CURLHEADER_SEPARATE')) {
$curlopts[\CURLOPT_HEADEROPT] = \CURLHEADER_SEPARATE;
}
diff --git a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php
index 8f765877bd..1adc84156a 100644
--- a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php
+++ b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php
@@ -216,7 +216,7 @@ class UploadedFile extends File
/**
* Returns the maximum size of an uploaded file as configured in php.ini.
*
- * @return int The maximum size of an uploaded file in bytes
+ * @return int|float The maximum size of an uploaded file in bytes (returns float if size > PHP_INT_MAX)
*/
public static function getMaxFilesize()
{
@@ -228,8 +228,10 @@ class UploadedFile extends File
/**
* Returns the given size from an ini value in bytes.
+ *
+ * @return int|float Returns float if size > PHP_INT_MAX
*/
- private static function parseFilesize($size): int
+ private static function parseFilesize($size)
{
if ('' === $size) {
return 0;
diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php
index 83213ba4bd..617b101f9a 100644
--- a/src/Symfony/Component/HttpFoundation/Request.php
+++ b/src/Symfony/Component/HttpFoundation/Request.php
@@ -1895,15 +1895,9 @@ class Request
}
$basename = basename($baseUrl);
- if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.$basename.'/')) {
- // strip autoindex filename, for virtualhost based on URL path
- $baseUrl = \dirname($baseUrl).'/';
-
- $basename = basename($baseUrl);
- if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.$basename.'/')) {
- // no match whatsoever; set it blank
- return '';
- }
+ if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) {
+ // no match whatsoever; set it blank
+ return '';
}
// If using mod_rewrite or ISAPI_Rewrite strip the script filename
diff --git a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
index e558870a92..2b20819b7a 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
@@ -15,6 +15,7 @@ use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\File\Exception\CannotWriteFileException;
use Symfony\Component\HttpFoundation\File\Exception\ExtensionFileException;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
+use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
use Symfony\Component\HttpFoundation\File\Exception\FormSizeFileException;
use Symfony\Component\HttpFoundation\File\Exception\IniSizeFileException;
use Symfony\Component\HttpFoundation\File\Exception\NoFileException;
@@ -33,7 +34,7 @@ class UploadedFileTest extends TestCase
public function testConstructWhenFileNotExists()
{
- $this->expectException(\Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException::class);
+ $this->expectException(FileNotFoundException::class);
new UploadedFile(
__DIR__.'/Fixtures/not_here',
@@ -324,13 +325,16 @@ class UploadedFileTest extends TestCase
{
$size = UploadedFile::getMaxFilesize();
- $this->assertIsInt($size);
+ if ($size > \PHP_INT_MAX) {
+ $this->assertIsFloat($size);
+ } else {
+ $this->assertIsInt($size);
+ }
+
$this->assertGreaterThan(0, $size);
if (0 === (int) ini_get('post_max_size') && 0 === (int) ini_get('upload_max_filesize')) {
$this->assertSame(\PHP_INT_MAX, $size);
- } else {
- $this->assertLessThan(\PHP_INT_MAX, $size);
}
}
}
diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
index ee6f87e7f9..41167993f5 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
@@ -1793,8 +1793,8 @@ class RequestTest extends TestCase
'SCRIPT_NAME' => '/foo/app.php',
'PHP_SELF' => '/foo/app.php',
],
- '/sub/foo',
- '/bar',
+ '',
+ '/sub/foo/bar',
],
[
'/sub/foo/app.php/bar',
@@ -1813,8 +1813,18 @@ class RequestTest extends TestCase
'SCRIPT_NAME' => '/foo/app2.phpx',
'PHP_SELF' => '/foo/app2.phpx',
],
- '/sub/foo',
- '/bar/baz',
+ '',
+ '/sub/foo/bar/baz',
+ ],
+ [
+ '/foo/api/bar',
+ [
+ 'SCRIPT_FILENAME' => '/var/www/api/index.php',
+ 'SCRIPT_NAME' => '/api/index.php',
+ 'PHP_SELF' => '/api/index.php',
+ ],
+ '',
+ '/foo/api/bar',
],
];
}
diff --git a/src/Symfony/Component/Ldap/Security/LdapUserProvider.php b/src/Symfony/Component/Ldap/Security/LdapUserProvider.php
index c593a1376e..50b82f76cb 100644
--- a/src/Symfony/Component/Ldap/Security/LdapUserProvider.php
+++ b/src/Symfony/Component/Ldap/Security/LdapUserProvider.php
@@ -73,18 +73,27 @@ class LdapUserProvider implements UserProviderInterface, PasswordUpgraderInterfa
$query = str_replace('{username}', $username, $this->defaultSearch);
$search = $this->ldap->query($this->baseDn, $query);
} catch (ConnectionException $e) {
- throw new UsernameNotFoundException(sprintf('User "%s" not found.', $username), 0, $e);
+ $e = new UsernameNotFoundException(sprintf('User "%s" not found.', $username), 0, $e);
+ $e->setUsername($username);
+
+ throw $e;
}
$entries = $search->execute();
$count = \count($entries);
if (!$count) {
- throw new UsernameNotFoundException(sprintf('User "%s" not found.', $username));
+ $e = new UsernameNotFoundException(sprintf('User "%s" not found.', $username));
+ $e->setUsername($username);
+
+ throw $e;
}
if ($count > 1) {
- throw new UsernameNotFoundException('More than one user found.');
+ $e = new UsernameNotFoundException('More than one user found.');
+ $e->setUsername($username);
+
+ throw $e;
}
$entry = $entries[0];
diff --git a/src/Symfony/Component/Security/Guard/Provider/GuardAuthenticationProvider.php b/src/Symfony/Component/Security/Guard/Provider/GuardAuthenticationProvider.php
index 7e9258a9c5..49244680ad 100644
--- a/src/Symfony/Component/Security/Guard/Provider/GuardAuthenticationProvider.php
+++ b/src/Symfony/Component/Security/Guard/Provider/GuardAuthenticationProvider.php
@@ -105,7 +105,10 @@ class GuardAuthenticationProvider implements AuthenticationProviderInterface
$user = $guardAuthenticator->getUser($token->getCredentials(), $this->userProvider);
if (null === $user) {
- throw new UsernameNotFoundException(sprintf('Null returned from "%s::getUser()".', get_debug_type($guardAuthenticator)));
+ $e = new UsernameNotFoundException(sprintf('Null returned from "%s::getUser()".', get_debug_type($guardAuthenticator)));
+ $e->setUsername($token->getUsername());
+
+ throw $e;
}
if (!$user instanceof UserInterface) {
diff --git a/src/Symfony/Component/Translation/README.md b/src/Symfony/Component/Translation/README.md
index f4f1706675..dc090df5b3 100644
--- a/src/Symfony/Component/Translation/README.md
+++ b/src/Symfony/Component/Translation/README.md
@@ -12,8 +12,10 @@ $ composer require symfony/translation
```php
use Symfony\Component\Translation\Translator;
+use Symfony\Component\Translation\Loader\ArrayLoader;
$translator = new Translator('fr_FR');
+$translator->addLoader('array', new ArrayLoader());
$translator->addResource('array', [
'Hello World!' => 'Bonjour !',
], 'fr_FR');
diff --git a/src/Symfony/Component/Uid/Ulid.php b/src/Symfony/Component/Uid/Ulid.php
index 41dbd1c96c..0316dc58e8 100644
--- a/src/Symfony/Component/Uid/Ulid.php
+++ b/src/Symfony/Component/Uid/Ulid.php
@@ -104,6 +104,9 @@ class Ulid extends AbstractUid
return $this->uid;
}
+ /**
+ * @return float Seconds since the Unix epoch 1970-01-01 00:00:00
+ */
public function getTime(): float
{
$time = strtr(substr($this->uid, 0, 10), 'ABCDEFGHJKMNPQRSTVWXYZ', 'abcdefghijklmnopqrstuv');
diff --git a/src/Symfony/Component/Uid/UuidV1.php b/src/Symfony/Component/Uid/UuidV1.php
index ba7282c07d..2710a9db49 100644
--- a/src/Symfony/Component/Uid/UuidV1.php
+++ b/src/Symfony/Component/Uid/UuidV1.php
@@ -31,6 +31,9 @@ class UuidV1 extends Uuid
}
}
+ /**
+ * @return float Seconds since the Unix epoch 1970-01-01 00:00:00
+ */
public function getTime(): float
{
$time = '0'.substr($this->uid, 15, 3).substr($this->uid, 9, 4).substr($this->uid, 0, 8);
diff --git a/src/Symfony/Component/Uid/UuidV6.php b/src/Symfony/Component/Uid/UuidV6.php
index b395063847..79cab4c15c 100644
--- a/src/Symfony/Component/Uid/UuidV6.php
+++ b/src/Symfony/Component/Uid/UuidV6.php
@@ -50,6 +50,9 @@ class UuidV6 extends Uuid
}
}
+ /**
+ * @return float Seconds since the Unix epoch 1970-01-01 00:00:00
+ */
public function getTime(): float
{
$time = '0'.substr($this->uid, 0, 8).substr($this->uid, 9, 4).substr($this->uid, 15, 3);
diff --git a/src/Symfony/Component/Validator/Constraints/FileValidator.php b/src/Symfony/Component/Validator/Constraints/FileValidator.php
index 3142f4cea6..9cc68346a5 100644
--- a/src/Symfony/Component/Validator/Constraints/FileValidator.php
+++ b/src/Symfony/Component/Validator/Constraints/FileValidator.php
@@ -214,8 +214,10 @@ class FileValidator extends ConstraintValidator
/**
* Convert the limit to the smallest possible number
* (i.e. try "MB", then "kB", then "bytes").
+ *
+ * @param int|float $limit
*/
- private function factorizeSizes(int $size, int $limit, bool $binaryFormat): array
+ private function factorizeSizes(int $size, $limit, bool $binaryFormat): array
{
if ($binaryFormat) {
$coef = self::MIB_BYTES;
diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf
index dfaed73d2f..4c10d6462b 100644
--- a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf
+++ b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf
@@ -84,7 +84,7 @@
- הערך קצר מידי. הוא צריך להכיל {{ limit }} תווים לפחות.|הערך קצר מידיץ הוא צריך להכיל {{ limit }} תווים לפחות.
+ הערך קצר מידי. הוא צריך להכיל {{ limit }} תווים לפחות.|הערך קצר מידי. הערך צריך להכיל {{ limit }} תווים לפחות.
diff --git a/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
index 36987b26a4..03a2e27b80 100644
--- a/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
+++ b/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
@@ -506,14 +506,12 @@ abstract class FileValidatorTest extends ConstraintValidatorTestCase
[, $limit, $suffix] = $method->invokeArgs(new FileValidator(), [0, UploadedFile::getMaxFilesize(), false]);
// it correctly parses the maxSize option and not only uses simple string comparison
- // 1000M should be bigger than the ini value
+ // 1000G should be bigger than the ini value
$tests[] = [(string) \UPLOAD_ERR_INI_SIZE, 'uploadIniSizeErrorMessage', [
'{{ limit }}' => $limit,
'{{ suffix }}' => $suffix,
- ], '1000M'];
+ ], '1000G'];
- // it correctly parses the maxSize option and not only uses simple string comparison
- // 1000M should be bigger than the ini value
$tests[] = [(string) \UPLOAD_ERR_INI_SIZE, 'uploadIniSizeErrorMessage', [
'{{ limit }}' => '0.1',
'{{ suffix }}' => 'MB',