|
17 | 17 | use CodeIgniter\HTTP\Exceptions\HTTPException; |
18 | 18 | use Config\Mimes; |
19 | 19 | use Exception; |
20 | | -use InvalidArgumentException; |
21 | | -use RuntimeException; |
22 | 20 |
|
23 | 21 | /** |
24 | 22 | * Value object representing a single file uploaded through an |
@@ -82,12 +80,12 @@ class UploadedFile extends File implements UploadedFileInterface |
82 | 80 | /** |
83 | 81 | * Accepts the file information as would be filled in from the $_FILES array. |
84 | 82 | * |
85 | | - * @param string $path The temporary location of the uploaded file. |
86 | | - * @param string $originalName The client-provided filename. |
87 | | - * @param string $mimeType The type of file as provided by PHP |
88 | | - * @param int $size The size of the file, in bytes |
89 | | - * @param int $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) |
90 | | - * @param string $clientPath The webkit relative path of the uploaded file. |
| 83 | + * @param string $path The temporary location of the uploaded file. |
| 84 | + * @param string $originalName The client-provided filename. |
| 85 | + * @param string|null $mimeType The type of file as provided by PHP |
| 86 | + * @param int|null $size The size of the file, in bytes |
| 87 | + * @param int|null $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) |
| 88 | + * @param string|null $clientPath The webkit relative path of the uploaded file. |
91 | 89 | */ |
92 | 90 | public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $size = null, ?int $error = null, ?string $clientPath = null) |
93 | 91 | { |
@@ -124,16 +122,12 @@ public function __construct(string $path, string $originalName, ?string $mimeTyp |
124 | 122 | * @see http://php.net/is_uploaded_file |
125 | 123 | * @see http://php.net/move_uploaded_file |
126 | 124 | * |
127 | | - * @param string $targetPath Path to which to move the uploaded file. |
128 | | - * @param string $name the name to rename the file to. |
129 | | - * @param bool $overwrite State for indicating whether to overwrite the previously generated file with the same |
130 | | - * name or not. |
| 125 | + * @param string $targetPath Path to which to move the uploaded file. |
| 126 | + * @param string|null $name the name to rename the file to. |
| 127 | + * @param bool $overwrite State for indicating whether to overwrite the previously generated file with the same |
| 128 | + * name or not. |
131 | 129 | * |
132 | 130 | * @return bool |
133 | | - * |
134 | | - * @throws InvalidArgumentException if the $path specified is invalid. |
135 | | - * @throws RuntimeException on any error during the move operation. |
136 | | - * @throws RuntimeException on the second or subsequent call to the method. |
137 | 131 | */ |
138 | 132 | public function move(string $targetPath, ?string $name = null, bool $overwrite = false) |
139 | 133 | { |
@@ -347,8 +341,8 @@ public function isValid(): bool |
347 | 341 | * By default, upload files are saved in writable/uploads directory. The YYYYMMDD folder |
348 | 342 | * and random file name will be created. |
349 | 343 | * |
350 | | - * @param string $folderName the folder name to writable/uploads directory. |
351 | | - * @param string $fileName the name to rename the file to. |
| 344 | + * @param string|null $folderName the folder name to writable/uploads directory. |
| 345 | + * @param string|null $fileName the name to rename the file to. |
352 | 346 | * |
353 | 347 | * @return string file full path |
354 | 348 | */ |
|
0 commit comments