refactor:优化文件上传类设置文件方法的参数类型

This commit is contained in:
妙码生花 2024-03-18 14:12:44 +08:00
parent 6f3414c513
commit 4722fecd64

View File

@ -66,11 +66,11 @@ class Upload
/**
* 设置文件
* @param UploadedFile $file
* @param ?UploadedFile $file
* @return array 文件信息
* @throws Throwable
*/
public function setFile(UploadedFile $file): array
public function setFile(?UploadedFile $file): array
{
if (empty($file)) {
throw new Exception(__('No files were uploaded'), 10001);