diff options
author | Olivier Paroz <github@oparoz.com> | 2015-01-18 05:03:35 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-01-18 05:03:35 +0300 |
commit | aa176a85154a66898139a4daee7181913e1d501b (patch) | |
tree | 08cbfa98391b2c22cf2ecc9dc42e33bb4b193747 | |
parent | ee5c0a94cb1571f5675fd9caf8a7ca0a77927d20 (diff) |
Minor fixes and cleanup
-rw-r--r-- | controller/jsonhttperror.php | 4 | ||||
-rw-r--r-- | controller/servicecontroller.php | 4 | ||||
-rw-r--r-- | environment/environment.php | 2 | ||||
-rw-r--r-- | environment/notfoundenvexception.php | 10 | ||||
-rw-r--r-- | middleware/envcheckmiddleware.php | 2 | ||||
-rw-r--r-- | service/notfoundserviceexception.php | 12 | ||||
-rw-r--r-- | service/previewservice.php | 2 | ||||
-rw-r--r-- | service/thumbnailservice.php | 24 |
8 files changed, 11 insertions, 49 deletions
diff --git a/controller/jsonhttperror.php b/controller/jsonhttperror.php index 6f7fe2b9..9de6653e 100644 --- a/controller/jsonhttperror.php +++ b/controller/jsonhttperror.php @@ -39,7 +39,9 @@ trait JsonHttpError { $message = $exception->getMessage(); $code = Http::STATUS_INTERNAL_SERVER_ERROR; - if ($exception instanceof NotFoundServiceException || $exception instanceof NotFoundEnvException) { + if ($exception instanceof NotFoundServiceException + || $exception instanceof NotFoundEnvException + ) { $code = Http::STATUS_NOT_FOUND; } diff --git a/controller/servicecontroller.php b/controller/servicecontroller.php index 24959c58..ae12637d 100644 --- a/controller/servicecontroller.php +++ b/controller/servicecontroller.php @@ -112,7 +112,7 @@ class ServiceController extends Controller { * * @param string $albumpath * - * @return array<string,int>|Http\JSONResponse + * @return false|array<string,int>|Http\JSONResponse */ public function getAlbumInfo($albumpath) { try { @@ -254,7 +254,7 @@ class ServiceController extends Controller { * @param bool $square * @param bool $scale * - * @return array + * @return array|Http\JSONResponse */ private function getThumbnail($image, $square, $scale) { try { diff --git a/environment/environment.php b/environment/environment.php index 480b9076..f4df3324 100644 --- a/environment/environment.php +++ b/environment/environment.php @@ -189,7 +189,7 @@ class Environment { * * @return string */ - public function getUserID() { + public function getUserId() { return $this->userId; } diff --git a/environment/notfoundenvexception.php b/environment/notfoundenvexception.php index 9589fa9a..991c1447 100644 --- a/environment/notfoundenvexception.php +++ b/environment/notfoundenvexception.php @@ -15,12 +15,4 @@ namespace OCA\GalleryPlus\Environment; /** * Thrown when the service cannot reply to a request */ -class NotFoundEnvException extends EnvironmentException { - - /** - * Constructor - * - * @param string $msg the message contained in the exception - */ - public function __construct($msg) {} -}
\ No newline at end of file +class NotFoundEnvException extends EnvironmentException {}
\ No newline at end of file diff --git a/middleware/envcheckmiddleware.php b/middleware/envcheckmiddleware.php index 1e4de129..d6ba520a 100644 --- a/middleware/envcheckmiddleware.php +++ b/middleware/envcheckmiddleware.php @@ -157,7 +157,7 @@ class EnvCheckMiddleware extends CheckMiddleware { * * @param string $token * - * @return array|bool + * @return array * * @throws CheckException */ diff --git a/service/notfoundserviceexception.php b/service/notfoundserviceexception.php index 298f7bbd..3f83f84a 100644 --- a/service/notfoundserviceexception.php +++ b/service/notfoundserviceexception.php @@ -15,14 +15,4 @@ namespace OCA\GalleryPlus\Service; /** * Thrown when the service cannot reply to a request */ -class NotFoundServiceException extends ServiceException { - - /** - * Constructor - * - * @param string $msg the message contained in the exception - */ - public function __construct($msg) { - parent::__construct($msg); - } -}
\ No newline at end of file +class NotFoundServiceException extends ServiceException {}
\ No newline at end of file diff --git a/service/previewservice.php b/service/previewservice.php index b8d5ba85..1bd0a2ce 100644 --- a/service/previewservice.php +++ b/service/previewservice.php @@ -131,7 +131,7 @@ class PreviewService extends Service { } catch (NotFoundEnvException $exception) { $this->logAndThrowNotFound($exception->getMessage()); } - $userId = $this->environment->getUserID(); + $userId = $this->environment->getUserId(); $imagePathFromFolder = $this->environment->getImagePathFromFolder($image); $this->previewManager->setupView($userId, $file, $imagePathFromFolder); diff --git a/service/thumbnailservice.php b/service/thumbnailservice.php index 86922927..658b731e 100644 --- a/service/thumbnailservice.php +++ b/service/thumbnailservice.php @@ -27,28 +27,6 @@ use OCA\GalleryPlus\Utility\SmarterLogger; class ThumbnailService extends PreviewService { /** - * Constructor - * - * @param string $appName - * @param Environment $environment - * @param Preview $previewManager - * @param SmarterLogger $logger - */ - public function __construct( - $appName, - Environment $environment, - Preview $previewManager, - SmarterLogger $logger - ) { - parent::__construct( - $appName, - $environment, - $previewManager, - $logger - ); - } - - /** * Creates thumbnails of asked dimensions and aspect * * * Album thumbnails need to be 200x200 and some will be resized by the @@ -70,7 +48,7 @@ class ThumbnailService extends PreviewService { * @param bool $square * @param bool $scale * - * @return array + * @return array<string,string> */ public function createThumbnail($image, $square, $scale) { $height = 200 * $scale; |