Skip to content

Commit 4b181dd

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: [HttpFoundation] Drop int return type from parseFilesize() Added $translator->addLoader() bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameNotFoundException [Uid] Clarify the format returned by getTime() fix spelling Add check for constant in Curl client Revert #38614, add assert to avoid regression Fix container injection with TypedReference Fix problem when SYMFONY_PHPUNIT_VERSION is empty string value Update PHP CS Fixer config to v2.18
2 parents 7e1bcce + d56dd3e commit 4b181dd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Constraints/FileValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ private static function moreDecimalsThan(string $double, int $numberOfDecimals):
214214
/**
215215
* Convert the limit to the smallest possible number
216216
* (i.e. try "MB", then "kB", then "bytes").
217+
*
218+
* @param int|float $limit
217219
*/
218-
private function factorizeSizes(int $size, int $limit, bool $binaryFormat): array
220+
private function factorizeSizes(int $size, $limit, bool $binaryFormat): array
219221
{
220222
if ($binaryFormat) {
221223
$coef = self::MIB_BYTES;

Resources/translations/validators.he.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
</trans-unit>
8585
<trans-unit id="21">
8686
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
87-
<target>הערך קצר מידי. הוא צריך להכיל {{ limit }} תווים לפחות.|הערך קצר מידיץ הוא צריך להכיל {{ limit }} תווים לפחות.</target>
87+
<target>הערך קצר מידי. הוא צריך להכיל {{ limit }} תווים לפחות.|הערך קצר מידי. הערך צריך להכיל {{ limit }} תווים לפחות.</target>
8888
</trans-unit>
8989
<trans-unit id="22">
9090
<source>This value should not be blank.</source>

Tests/Constraints/FileValidatorTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,12 @@ public function uploadedFileErrorProvider()
506506
[, $limit, $suffix] = $method->invokeArgs(new FileValidator(), [0, UploadedFile::getMaxFilesize(), false]);
507507

508508
// it correctly parses the maxSize option and not only uses simple string comparison
509-
// 1000M should be bigger than the ini value
509+
// 1000G should be bigger than the ini value
510510
$tests[] = [(string) \UPLOAD_ERR_INI_SIZE, 'uploadIniSizeErrorMessage', [
511511
'{{ limit }}' => $limit,
512512
'{{ suffix }}' => $suffix,
513-
], '1000M'];
513+
], '1000G'];
514514

515-
// it correctly parses the maxSize option and not only uses simple string comparison
516-
// 1000M should be bigger than the ini value
517515
$tests[] = [(string) \UPLOAD_ERR_INI_SIZE, 'uploadIniSizeErrorMessage', [
518516
'{{ limit }}' => '0.1',
519517
'{{ suffix }}' => 'MB',

0 commit comments

Comments
 (0)