Skip to content

Commit

Permalink
refactor: remove sf4 compatibility and deprecate obsolete parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hshn committed Dec 6, 2023
1 parent 4695239 commit e9d2da7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/HttpFoundation/File/UploadedBase64EncodedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ class UploadedBase64EncodedFile extends UploadedFile
*/
public function __construct(Base64EncodedFile $file, $originalName = '', $mimeType = null, $size = null)
{
$method = new \ReflectionMethod(parent::class, '__construct');
$num = $method->getNumberOfParameters();
if (5 === $num) {
parent::__construct($file->getPathname(), $originalName ?: $file->getFilename(), $mimeType, null, true);
} else {
// Symfony 4 compatible
parent::__construct($file->getPathname(), $originalName ?: $file->getFilename(), $mimeType, $size, null, true);
if ($size !== null) {
trigger_error('The $size argument is removed since Symfony 5.0 and we will removed it in 6.0.', E_USER_DEPRECATED);
}

parent::__construct($file->getPathname(), $originalName ?: $file->getFilename(), $mimeType, null, true);
}
}

0 comments on commit e9d2da7

Please sign in to comment.