Skip to content

Commit da918f6

Browse files
LukeTowersnicolas-grekas
authored andcommitted
[HttpFoundation] Drop int return type from parseFilesize()
1 parent a6ac3f0 commit da918f6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Extension/Core/Type/FileType.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ private function getFileUploadError(int $errorCode)
178178
* Returns the maximum size of an uploaded file as configured in php.ini.
179179
*
180180
* This method should be kept in sync with Symfony\Component\HttpFoundation\File\UploadedFile::getMaxFilesize().
181+
*
182+
* @return int|float The maximum size of an uploaded file in bytes (returns float if size > PHP_INT_MAX)
181183
*/
182-
private static function getMaxFilesize(): int
184+
private static function getMaxFilesize()
183185
{
184186
$iniMax = strtolower(ini_get('upload_max_filesize'));
185187

@@ -214,8 +216,10 @@ private static function getMaxFilesize(): int
214216
* (i.e. try "MB", then "kB", then "bytes").
215217
*
216218
* This method should be kept in sync with Symfony\Component\Validator\Constraints\FileValidator::factorizeSizes().
219+
*
220+
* @param int|float $limit
217221
*/
218-
private function factorizeSizes(int $size, int $limit)
222+
private function factorizeSizes(int $size, $limit)
219223
{
220224
$coef = self::MIB_BYTES;
221225
$coefFactor = self::KIB_BYTES;

0 commit comments

Comments
 (0)