diff --git a/lib/Controller/AlbumsController.php b/lib/Controller/AlbumsController.php index bd7acf30..6c0b05e8 100644 --- a/lib/Controller/AlbumsController.php +++ b/lib/Controller/AlbumsController.php @@ -34,7 +34,7 @@ class AlbumsController extends ApiBase * * Get list of albums with counts of images */ - public function albums(int $t = 0): JSONResponse + public function albums(int $t = 0): Http\Response { $user = $this->userSession->getUser(); if (null === $user) { @@ -75,7 +75,7 @@ class AlbumsController extends ApiBase * * Download an album as a zip file */ - public function download(string $name = ''): JSONResponse + public function download(string $name = ''): Http\Response { $user = $this->userSession->getUser(); if (null === $user) { diff --git a/lib/Controller/ApiBase.php b/lib/Controller/ApiBase.php index 360c1088..13f480b9 100644 --- a/lib/Controller/ApiBase.php +++ b/lib/Controller/ApiBase.php @@ -325,7 +325,7 @@ class ApiBase extends Controller /** * Given a list of file ids, return the first preview image possible. */ - protected function getPreviewFromImageList(array $list, int $quality = 512) + protected function getPreviewFromImageList(array $list, int $quality = 512): Http\Response { // Get preview manager $previewManager = \OC::$server->get(\OCP\IPreview::class); diff --git a/lib/Controller/ArchiveController.php b/lib/Controller/ArchiveController.php index 3d65c551..9adc8044 100644 --- a/lib/Controller/ArchiveController.php +++ b/lib/Controller/ArchiveController.php @@ -38,7 +38,7 @@ class ArchiveController extends ApiBase * * @param string fileid */ - public function archive(string $id): JSONResponse + public function archive(string $id): Http\Response { $user = $this->userSession->getUser(); if (null === $user) { diff --git a/lib/Controller/DaysController.php b/lib/Controller/DaysController.php index 1cfd31ce..a86459af 100644 --- a/lib/Controller/DaysController.php +++ b/lib/Controller/DaysController.php @@ -37,7 +37,7 @@ class DaysController extends ApiBase * * @PublicPage */ - public function days(): JSONResponse + public function days(): Http\Response { // Get the folder to show try { @@ -94,7 +94,7 @@ class DaysController extends ApiBase * * @PublicPage */ - public function day(string $id): JSONResponse + public function day(string $id): Http\Response { // Get user $uid = $this->getUID(); @@ -163,7 +163,7 @@ class DaysController extends ApiBase * * @PublicPage */ - public function dayPost(): JSONResponse + public function dayPost(): Http\Response { $id = $this->request->getParam('body_ids'); if (null === $id) { diff --git a/lib/Controller/DownloadController.php b/lib/Controller/DownloadController.php index 8add29a1..100c58e8 100644 --- a/lib/Controller/DownloadController.php +++ b/lib/Controller/DownloadController.php @@ -42,7 +42,7 @@ class DownloadController extends ApiBase * * Request to download one or more files */ - public function request(): JSONResponse + public function request(): Http\Response { // Get ids from body $files = $this->request->getParam('files'); diff --git a/lib/Controller/ImageController.php b/lib/Controller/ImageController.php index 6e3c7a4b..e9f14e7a 100644 --- a/lib/Controller/ImageController.php +++ b/lib/Controller/ImageController.php @@ -181,7 +181,7 @@ class ImageController extends ApiBase bool $basic = false, bool $current = false, bool $tags = false - ): JSONResponse { + ): Http\Response { $file = $this->getUserFile((int) $id); if (!$file) { return Errors::NotFoundFile($id); @@ -222,7 +222,7 @@ class ImageController extends ApiBase * @param string fileid * @param array raw exif data */ - public function setExif(string $id, array $raw): JSONResponse + public function setExif(string $id, array $raw): Http\Response { $file = $this->getUserFile((int) $id); if (!$file) { @@ -267,7 +267,7 @@ class ImageController extends ApiBase * The returned image may be png / webp / jpeg / gif. * These formats are supported by all browsers. */ - public function decodable(string $id) + public function decodable(string $id): Http\Response { $file = $this->getUserFile((int) $id); if (!$file) { diff --git a/lib/Controller/MapController.php b/lib/Controller/MapController.php index 7c311cee..636af650 100644 --- a/lib/Controller/MapController.php +++ b/lib/Controller/MapController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace OCA\Memories\Controller; use OCA\Memories\Errors; +use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; class MapController extends ApiBase @@ -31,7 +32,7 @@ class MapController extends ApiBase /** * @NoAdminRequired */ - public function clusters(): JSONResponse + public function clusters(): Http\Response { // Get the folder to show $root = null; diff --git a/lib/Controller/OtherController.php b/lib/Controller/OtherController.php index 0e7f8444..61372c55 100644 --- a/lib/Controller/OtherController.php +++ b/lib/Controller/OtherController.php @@ -41,7 +41,7 @@ class OtherController extends ApiBase * * @return JSONResponse an empty JSONResponse with respective http status code */ - public function setUserConfig(string $key, string $value): JSONResponse + public function setUserConfig(string $key, string $value): Http\Response { $user = $this->userSession->getUser(); if (null === $user) { diff --git a/lib/Controller/PeopleController.php b/lib/Controller/PeopleController.php index 50e400f5..a1fa1fd1 100644 --- a/lib/Controller/PeopleController.php +++ b/lib/Controller/PeopleController.php @@ -37,7 +37,7 @@ class PeopleController extends ApiBase * * Get list of faces with counts of images */ - public function recognizePeople(): JSONResponse + public function recognizePeople(): Http\Response { try { $uid = $this->getUID(); @@ -58,7 +58,8 @@ class PeopleController extends ApiBase // Run actual query $list = $this->timelineQuery->getPeopleRecognize( - $root, $uid + $root, + $uid ); return new JSONResponse($list, Http::STATUS_OK); @@ -107,7 +108,7 @@ class PeopleController extends ApiBase * * Get list of faces with counts of images */ - public function facerecognitionPeople(): JSONResponse + public function facerecognitionPeople(): Http\Response { $user = $this->userSession->getUser(); if (null === $user) { diff --git a/lib/Controller/PlacesController.php b/lib/Controller/PlacesController.php index 44ddd4f4..a632c938 100644 --- a/lib/Controller/PlacesController.php +++ b/lib/Controller/PlacesController.php @@ -34,7 +34,7 @@ class PlacesController extends ApiBase * * Get list of places with counts of images */ - public function places(): JSONResponse + public function places(): Http\Response { $user = $this->userSession->getUser(); if (null === $user) { diff --git a/lib/Controller/ShareController.php b/lib/Controller/ShareController.php index 74c86bfe..d5878412 100644 --- a/lib/Controller/ShareController.php +++ b/lib/Controller/ShareController.php @@ -37,7 +37,7 @@ class ShareController extends ApiBase * @param mixed $id * @param mixed $path */ - public function links($id, $path) + public function links($id, $path): Http\Response { $file = $this->getNodeByIdOrPath($id, $path); if (!$file) { @@ -65,7 +65,7 @@ class ShareController extends ApiBase * @param mixed $id * @param mixed $path */ - public function createNode($id, $path) + public function createNode($id, $path): Http\Response { $file = $this->getNodeByIdOrPath($id, $path); if (!$file) { @@ -92,7 +92,7 @@ class ShareController extends ApiBase * * Delete an external link share */ - public function deleteShare(string $id) + public function deleteShare(string $id): Http\Response { $uid = $this->getUID(); if (!$uid) { diff --git a/lib/Controller/TagsController.php b/lib/Controller/TagsController.php index a847e3e3..70ad0fad 100644 --- a/lib/Controller/TagsController.php +++ b/lib/Controller/TagsController.php @@ -34,7 +34,7 @@ class TagsController extends ApiBase * * Get list of tags with counts of images */ - public function tags(): JSONResponse + public function tags(): Http\Response { $user = $this->userSession->getUser(); if (null === $user) { @@ -103,7 +103,7 @@ class TagsController extends ApiBase * * Set tags for a file */ - public function set(int $id, array $add, array $remove): JSONResponse + public function set(int $id, array $add, array $remove): Http\Response { // Check tags enabled for this user if (!$this->tagsIsEnabled()) {