diff options
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/FolderApiV2Controller.php | 13 | ||||
-rw-r--r-- | lib/Controller/JSONHttpErrorTrait.php | 4 |
2 files changed, 12 insertions, 5 deletions
diff --git a/lib/Controller/FolderApiV2Controller.php b/lib/Controller/FolderApiV2Controller.php index d8ad21fe6..3c9a12c14 100644 --- a/lib/Controller/FolderApiV2Controller.php +++ b/lib/Controller/FolderApiV2Controller.php @@ -24,7 +24,14 @@ class FolderApiV2Controller extends ApiController use ApiPayloadTrait; use JSONHttpErrorTrait; + /** + * @var FolderServiceV2 + */ private $folderService; + + /** + * @var ItemServiceV2 + */ private $itemService; public function __construct( @@ -47,7 +54,7 @@ class FolderApiV2Controller extends ApiController * @param string $name * @return array|mixed|\OCP\AppFramework\Http\JSONResponse */ - public function create($name) + public function create(string $name) { if (empty($name)) { return $this->errorResponseV2('folder name is empty', 1, Http::STATUS_BAD_REQUEST); @@ -70,7 +77,7 @@ class FolderApiV2Controller extends ApiController * @param string $name * @return array|\OCP\AppFramework\Http\JSONResponse */ - public function update($folderId, $name) + public function update(int $folderId, string $name) { if (empty($name)) { return $this->errorResponseV2('folder name is empty', 1, Http::STATUS_BAD_REQUEST); @@ -97,7 +104,7 @@ class FolderApiV2Controller extends ApiController * @param int $folderId * @return array|\OCP\AppFramework\Http\JSONResponse */ - public function delete($folderId) + public function delete(int $folderId) { try { $responseData = $this->serializeEntityV2( diff --git a/lib/Controller/JSONHttpErrorTrait.php b/lib/Controller/JSONHttpErrorTrait.php index 3defc47c1..abfef77a1 100644 --- a/lib/Controller/JSONHttpErrorTrait.php +++ b/lib/Controller/JSONHttpErrorTrait.php @@ -30,7 +30,7 @@ trait JSONHttpErrorTrait * @param int $code * @return \OCP\AppFramework\Http\JSONResponse */ - public function errorResponseWithExceptionV2(\Exception $exception, $code) + public function errorResponseWithExceptionV2(\Exception $exception, int $code): JSONResponse { return $this->errorResponseV2( $exception->getMessage(), @@ -45,7 +45,7 @@ trait JSONHttpErrorTrait * @param int $httpStatusCode * @return \OCP\AppFramework\Http\JSONResponse */ - public function errorResponseV2(string $message, int $code, int $httpStatusCode) + public function errorResponseV2(string $message, int $code, int $httpStatusCode): JSONResponse { return new JSONResponse([ 'error' => [ |