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