From a5f1685987913f736bed89dc9032c5c80732dab8 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 22 Mar 2023 11:40:56 -0700 Subject: [PATCH] refactor: rename base to generic Signed-off-by: Varun Patil --- lib/Controller/AlbumsController.php | 2 +- lib/Controller/ArchiveController.php | 2 +- lib/Controller/DaysController.php | 2 +- lib/Controller/DownloadController.php | 2 +- lib/Controller/{ApiBase.php => GenericApiController.php} | 8 ++++---- .../{ApiBaseFs.php => GenericApiControllerFs.php} | 6 +++--- .../{ApiBaseParams.php => GenericApiControllerParams.php} | 2 +- .../{ApiBaseUtils.php => GenericApiControllerUtils.php} | 2 +- lib/Controller/ImageController.php | 2 +- lib/Controller/MapController.php | 2 +- lib/Controller/OtherController.php | 2 +- lib/Controller/PeopleController.php | 2 +- lib/Controller/PlacesController.php | 2 +- lib/Controller/ShareController.php | 2 +- lib/Controller/TagsController.php | 2 +- lib/Controller/VideoController.php | 2 +- 16 files changed, 21 insertions(+), 21 deletions(-) rename lib/Controller/{ApiBase.php => GenericApiController.php} (92%) rename lib/Controller/{ApiBaseFs.php => GenericApiControllerFs.php} (98%) rename lib/Controller/{ApiBaseParams.php => GenericApiControllerParams.php} (97%) rename lib/Controller/{ApiBaseUtils.php => GenericApiControllerUtils.php} (99%) diff --git a/lib/Controller/AlbumsController.php b/lib/Controller/AlbumsController.php index 82c39297..8a3e676f 100644 --- a/lib/Controller/AlbumsController.php +++ b/lib/Controller/AlbumsController.php @@ -27,7 +27,7 @@ use OCA\Memories\Errors; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; -class AlbumsController extends ApiBase +class AlbumsController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/ArchiveController.php b/lib/Controller/ArchiveController.php index 9adc8044..23e22a75 100644 --- a/lib/Controller/ArchiveController.php +++ b/lib/Controller/ArchiveController.php @@ -29,7 +29,7 @@ use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\Files\Folder; -class ArchiveController extends ApiBase +class ArchiveController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/DaysController.php b/lib/Controller/DaysController.php index a86459af..9a7344d5 100644 --- a/lib/Controller/DaysController.php +++ b/lib/Controller/DaysController.php @@ -28,7 +28,7 @@ use OCA\Memories\Errors; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; -class DaysController extends ApiBase +class DaysController extends GenericApiController { use FoldersTrait; diff --git a/lib/Controller/DownloadController.php b/lib/Controller/DownloadController.php index 100c58e8..f554de2b 100644 --- a/lib/Controller/DownloadController.php +++ b/lib/Controller/DownloadController.php @@ -31,7 +31,7 @@ use OCP\ISession; use OCP\ITempManager; use OCP\Security\ISecureRandom; -class DownloadController extends ApiBase +class DownloadController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/ApiBase.php b/lib/Controller/GenericApiController.php similarity index 92% rename from lib/Controller/ApiBase.php rename to lib/Controller/GenericApiController.php index ef1762fd..a929db5e 100644 --- a/lib/Controller/ApiBase.php +++ b/lib/Controller/GenericApiController.php @@ -34,11 +34,11 @@ use OCP\IRequest; use OCP\IUserSession; use Psr\Log\LoggerInterface; -abstract class ApiBase extends Controller +abstract class GenericApiController extends Controller { - use ApiBaseFs; - use ApiBaseParams; - use ApiBaseUtils; + use GenericApiControllerFs; + use GenericApiControllerParams; + use GenericApiControllerUtils; protected IConfig $config; protected IUserSession $userSession; diff --git a/lib/Controller/ApiBaseFs.php b/lib/Controller/GenericApiControllerFs.php similarity index 98% rename from lib/Controller/ApiBaseFs.php rename to lib/Controller/GenericApiControllerFs.php index f659e88d..4ffffba7 100644 --- a/lib/Controller/ApiBaseFs.php +++ b/lib/Controller/GenericApiControllerFs.php @@ -33,10 +33,10 @@ use OCP\Files\IRootFolder; use OCP\IConfig; use OCP\IUserSession; -trait ApiBaseFs +trait GenericApiControllerFs { - use ApiBaseParams; - use ApiBaseUtils; + use GenericApiControllerParams; + use GenericApiControllerUtils; protected IConfig $config; protected IUserSession $userSession; diff --git a/lib/Controller/ApiBaseParams.php b/lib/Controller/GenericApiControllerParams.php similarity index 97% rename from lib/Controller/ApiBaseParams.php rename to lib/Controller/GenericApiControllerParams.php index 2210ec12..56192b47 100644 --- a/lib/Controller/ApiBaseParams.php +++ b/lib/Controller/GenericApiControllerParams.php @@ -23,7 +23,7 @@ declare(strict_types=1); namespace OCA\Memories\Controller; -trait ApiBaseParams +trait GenericApiControllerParams { /** * current request. diff --git a/lib/Controller/ApiBaseUtils.php b/lib/Controller/GenericApiControllerUtils.php similarity index 99% rename from lib/Controller/ApiBaseUtils.php rename to lib/Controller/GenericApiControllerUtils.php index 1fd9103b..bf6542c1 100644 --- a/lib/Controller/ApiBaseUtils.php +++ b/lib/Controller/GenericApiControllerUtils.php @@ -29,7 +29,7 @@ use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataDisplayResponse; use OCP\IConfig; -trait ApiBaseUtils +trait GenericApiControllerUtils { protected IAppManager $appManager; protected IConfig $config; diff --git a/lib/Controller/ImageController.php b/lib/Controller/ImageController.php index e9f14e7a..80e5e7d6 100644 --- a/lib/Controller/ImageController.php +++ b/lib/Controller/ImageController.php @@ -31,7 +31,7 @@ use OCP\AppFramework\Http\FileDisplayResponse; use OCP\AppFramework\Http\JSONResponse; use OCP\Files\IRootFolder; -class ImageController extends ApiBase +class ImageController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/MapController.php b/lib/Controller/MapController.php index 636af650..fced3f01 100644 --- a/lib/Controller/MapController.php +++ b/lib/Controller/MapController.php @@ -27,7 +27,7 @@ use OCA\Memories\Errors; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; -class MapController extends ApiBase +class MapController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/OtherController.php b/lib/Controller/OtherController.php index 61372c55..55018f67 100644 --- a/lib/Controller/OtherController.php +++ b/lib/Controller/OtherController.php @@ -29,7 +29,7 @@ use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\StreamResponse; -class OtherController extends ApiBase +class OtherController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/PeopleController.php b/lib/Controller/PeopleController.php index a1fa1fd1..ea406cf4 100644 --- a/lib/Controller/PeopleController.php +++ b/lib/Controller/PeopleController.php @@ -30,7 +30,7 @@ use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\JSONResponse; use OCP\Files\FileInfo; -class PeopleController extends ApiBase +class PeopleController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/PlacesController.php b/lib/Controller/PlacesController.php index a632c938..9cb55bae 100644 --- a/lib/Controller/PlacesController.php +++ b/lib/Controller/PlacesController.php @@ -27,7 +27,7 @@ use OCA\Memories\Errors; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; -class PlacesController extends ApiBase +class PlacesController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/ShareController.php b/lib/Controller/ShareController.php index d5878412..b19dfc3b 100644 --- a/lib/Controller/ShareController.php +++ b/lib/Controller/ShareController.php @@ -27,7 +27,7 @@ use OCA\Memories\Errors; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; -class ShareController extends ApiBase +class ShareController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/TagsController.php b/lib/Controller/TagsController.php index 70ad0fad..c69cd79f 100644 --- a/lib/Controller/TagsController.php +++ b/lib/Controller/TagsController.php @@ -27,7 +27,7 @@ use OCA\Memories\Errors; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; -class TagsController extends ApiBase +class TagsController extends GenericApiController { /** * @NoAdminRequired diff --git a/lib/Controller/VideoController.php b/lib/Controller/VideoController.php index 01a08d13..716fdcdd 100644 --- a/lib/Controller/VideoController.php +++ b/lib/Controller/VideoController.php @@ -30,7 +30,7 @@ use OCP\AppFramework\Http\DataDisplayResponse; use OCP\AppFramework\Http\JSONResponse; use OCP\Files\File; -class VideoController extends ApiBase +class VideoController extends GenericApiController { /** * @NoAdminRequired