mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-24 17:45:56 +00:00
refactor:优化文件上传类设置文件方法的参数类型
This commit is contained in:
parent
6f3414c513
commit
4722fecd64
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user