diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-21 16:45:36 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-21 16:45:36 +0200 |
commit | 42d69a95f3276a2d6089ca68f635c4e2f6aa7a23 (patch) | |
tree | 6a17fd7998f291e6dec1d996c1e7c724b92b8e58 /controller/folderapicontroller.php | |
parent | 0e6598b0734fb927109f745d9c0f3a8605a30ca5 (diff) |
convert tabs indention to indention with 4 spaces because of mixing of both variants in code and better readability on github and websites because you cant set the indention width there and 8 spaces will be used for a tab
Diffstat (limited to 'controller/folderapicontroller.php')
-rw-r--r-- | controller/folderapicontroller.php | 148 |
1 files changed, 74 insertions, 74 deletions
diff --git a/controller/folderapicontroller.php b/controller/folderapicontroller.php index 84f1dbdf5..ab2b5601f 100644 --- a/controller/folderapicontroller.php +++ b/controller/folderapicontroller.php @@ -26,36 +26,36 @@ use \OCA\News\Service\ServiceValidationException; class FolderApiController extends ApiController { - use JSONHttpError; - - private $folderService; - private $itemService; - private $userId; - private $serializer; - - public function __construct($appName, - IRequest $request, - FolderService $folderService, - ItemService $itemService, - $userId){ - parent::__construct($appName, $request); - $this->folderService = $folderService; - $this->itemService = $itemService; - $this->userId = $userId; - $this->serializer = new EntityApiSerializer('folders'); - } - - - /** - * @NoAdminRequired - * @NoCSRFRequired - * @CORS - */ - public function index() { - return $this->serializer->serialize( - $this->folderService->findAll($this->userId) - ); - } + use JSONHttpError; + + private $folderService; + private $itemService; + private $userId; + private $serializer; + + public function __construct($appName, + IRequest $request, + FolderService $folderService, + ItemService $itemService, + $userId){ + parent::__construct($appName, $request); + $this->folderService = $folderService; + $this->itemService = $itemService; + $this->userId = $userId; + $this->serializer = new EntityApiSerializer('folders'); + } + + + /** + * @NoAdminRequired + * @NoCSRFRequired + * @CORS + */ + public function index() { + return $this->serializer->serialize( + $this->folderService->findAll($this->userId) + ); + } /** @@ -66,18 +66,18 @@ class FolderApiController extends ApiController { * @param string $name * @return array|mixed|\OCP\AppFramework\Http\JSONResponse */ - public function create($name) { - try { - $this->folderService->purgeDeleted($this->userId, false); - return $this->serializer->serialize( - $this->folderService->create($name, $this->userId) - ); - } catch(ServiceValidationException $ex) { - return $this->error($ex, Http::STATUS_UNPROCESSABLE_ENTITY); - } catch(ServiceConflictException $ex) { - return $this->error($ex, Http::STATUS_CONFLICT); - } - } + public function create($name) { + try { + $this->folderService->purgeDeleted($this->userId, false); + return $this->serializer->serialize( + $this->folderService->create($name, $this->userId) + ); + } catch(ServiceValidationException $ex) { + return $this->error($ex, Http::STATUS_UNPROCESSABLE_ENTITY); + } catch(ServiceConflictException $ex) { + return $this->error($ex, Http::STATUS_CONFLICT); + } + } /** @@ -88,15 +88,15 @@ class FolderApiController extends ApiController { * @param int $folderId * @return array|\OCP\AppFramework\Http\JSONResponse */ - public function delete($folderId) { - try { - $this->folderService->delete($folderId, $this->userId); - } catch(ServiceNotFoundException $ex) { - return $this->error($ex, Http::STATUS_NOT_FOUND); - } + public function delete($folderId) { + try { + $this->folderService->delete($folderId, $this->userId); + } catch(ServiceNotFoundException $ex) { + return $this->error($ex, Http::STATUS_NOT_FOUND); + } return []; - } + } /** @@ -107,33 +107,33 @@ class FolderApiController extends ApiController { * @param string $name * @return array|\OCP\AppFramework\Http\JSONResponse */ - public function update($folderId, $name) { - try { - $this->folderService->rename($folderId, $name, $this->userId); - - } catch(ServiceValidationException $ex) { - return $this->error($ex, Http::STATUS_UNPROCESSABLE_ENTITY); - } catch(ServiceConflictException $ex) { - return $this->error($ex, Http::STATUS_CONFLICT); - } catch(ServiceNotFoundException $ex) { - return $this->error($ex, Http::STATUS_NOT_FOUND); - } + public function update($folderId, $name) { + try { + $this->folderService->rename($folderId, $name, $this->userId); + + } catch(ServiceValidationException $ex) { + return $this->error($ex, Http::STATUS_UNPROCESSABLE_ENTITY); + } catch(ServiceConflictException $ex) { + return $this->error($ex, Http::STATUS_CONFLICT); + } catch(ServiceNotFoundException $ex) { + return $this->error($ex, Http::STATUS_NOT_FOUND); + } return []; - } - - - /** - * @NoAdminRequired - * @NoCSRFRequired - * @CORS - * - * @param int $folderId - * @param int $newestItemId - */ - public function read($folderId, $newestItemId) { - $this->itemService->readFolder($folderId, $newestItemId, $this->userId); - } + } + + + /** + * @NoAdminRequired + * @NoCSRFRequired + * @CORS + * + * @param int $folderId + * @param int $newestItemId + */ + public function read($folderId, $newestItemId) { + $this->itemService->readFolder($folderId, $newestItemId, $this->userId); + } } |