Skip to content

Commit

Permalink
fix(FileManager): Incorrect return value in uploadFile.
Browse files Browse the repository at this point in the history
It should be specified directly that a boolean is expected, not true directly.
  • Loading branch information
CarlosEGuerraSilva committed Jul 17, 2024
1 parent 509910c commit 9d7d639
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions App/Core/Server/FileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,11 @@ public static function isFilenameValid($fileName): bool {
* @param bool $overwrite If true, the file will be overwritten if it already exists, false by default
* @param array|null $allowedMimeTypes Allowed mime types, null by default (all types allowed)
* @param bool $ignoreUsageCap If true, the app usage cap will be ignored, false by default
* @return true if the file was uploaded successfully or throws an exception on failure.
* @return bool true if the file was uploaded successfully or throws an exception on failure.
* @throws SystemIOException if failed to upload file because of invalid file name, file type, file size, file already exists, or failed to move file
* @throws StorageException if the disk does not have the minimum required space or the app disk usage exceeded (if ignoreUsageCap is false)
*/
public static function uploadFile(array $file, string $destination, int $maxFileSize = Configuration::MAX_UPLOAD_SIZE_MB, bool $overwrite = false, ?array $allowedMimeTypes = null, bool $ignoreUsageCap = false): true {
public static function uploadFile(array $file, string $destination, int $maxFileSize = Configuration::MAX_UPLOAD_SIZE_MB, bool $overwrite = false, ?array $allowedMimeTypes = null, bool $ignoreUsageCap = false): bool {
if (!self::isMinimumDiskSpaceAvailable()) {
throw new StorageException("Could not perform this action: Minimum disk space not available", self::ERR_NO_MINIMUM_STORAGE_SPACE);
}
Expand Down

0 comments on commit 9d7d639

Please sign in to comment.