diff --git a/src/UploadedFile.php b/src/UploadedFile.php index 1b9e3d4..0624179 100644 --- a/src/UploadedFile.php +++ b/src/UploadedFile.php @@ -104,8 +104,8 @@ public function __construct( $streamOrFile, int $size, int $error, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ) { if (!array_key_exists($error, self::ERRORS)) { throw new InvalidArgumentException(sprintf( diff --git a/src/UploadedFileFactory.php b/src/UploadedFileFactory.php index ad7d658..5238055 100644 --- a/src/UploadedFileFactory.php +++ b/src/UploadedFileFactory.php @@ -17,10 +17,10 @@ final class UploadedFileFactory implements UploadedFileFactoryInterface */ public function createUploadedFile( StreamInterface $stream, - int $size = null, + ?int $size = null, int $error = UPLOAD_ERR_OK, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ): UploadedFileInterface { $size = (int) ($size === null ? $stream->getSize() : $size); return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType);