From 35935469667e8deeaabd8ba338d6ed2e882dae71 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 28 Mar 2022 21:26:52 +0200 Subject: [PATCH] improve file upload and type hinting --- Controller/ApiController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index fe664b1..67413ea 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -145,7 +145,7 @@ final class ApiController extends Controller * FILE_PATH = combination of base path and virtual path * @param bool $hasAccountRelation The uploaded files should be related to an account * - * @return array + * @return Media[] * * @since 1.0.0 */ @@ -256,7 +256,7 @@ final class ApiController extends Controller * @param null|int $type Media type (internal categorization) * @param ApplicationAbstract $app Should create relation to uploader * - * @return null|Media + * @return Media * * @since 1.0.0 */ @@ -267,10 +267,10 @@ final class ApiController extends Controller int $type = null, string $ip = '127.0.0.1', ApplicationAbstract $app = null - ) : ?Media + ) : Media { if ($status['status'] !== UploadStatus::OK) { - return null; + return new NullMedia(); } $media = new Media();