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/foldercontroller.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/foldercontroller.php')
-rw-r--r-- | controller/foldercontroller.php | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/controller/foldercontroller.php b/controller/foldercontroller.php index 9488a7d6c..d5ccc7c62 100644 --- a/controller/foldercontroller.php +++ b/controller/foldercontroller.php @@ -27,34 +27,34 @@ use \OCA\News\Service\ServiceValidationException; class FolderController extends Controller { - use JSONHttpError; - - private $folderService; - private $feedService; - private $itemService; - private $userId; - - public function __construct($appName, - IRequest $request, - FolderService $folderService, - FeedService $feedService, - ItemService $itemService, - $userId) { - parent::__construct($appName, $request); - $this->folderService = $folderService; - $this->feedService = $feedService; - $this->itemService = $itemService; - $this->userId = $userId; - } - - - /** - * @NoAdminRequired - */ - public function index() { - $folders = $this->folderService->findAll($this->userId); - return ['folders' => $folders]; - } + use JSONHttpError; + + private $folderService; + private $feedService; + private $itemService; + private $userId; + + public function __construct($appName, + IRequest $request, + FolderService $folderService, + FeedService $feedService, + ItemService $itemService, + $userId) { + parent::__construct($appName, $request); + $this->folderService = $folderService; + $this->feedService = $feedService; + $this->itemService = $itemService; + $this->userId = $userId; + } + + + /** + * @NoAdminRequired + */ + public function index() { + $folders = $this->folderService->findAll($this->userId); + return ['folders' => $folders]; + } /** @@ -64,15 +64,15 @@ class FolderController extends Controller { * @param bool $open * @return array|\OCP\AppFramework\Http\JSONResponse */ - public function open($folderId, $open) { - try { - $this->folderService->open($folderId, $open, $this->userId); - } catch(ServiceNotFoundException $ex) { - return $this->error($ex, Http::STATUS_NOT_FOUND); - } + public function open($folderId, $open) { + try { + $this->folderService->open($folderId, $open, $this->userId); + } catch(ServiceNotFoundException $ex) { + return $this->error($ex, Http::STATUS_NOT_FOUND); + } return []; - } + } /** @@ -81,22 +81,22 @@ class FolderController extends Controller { * @param string $folderName * @return array|\OCP\AppFramework\Http\JSONResponse */ - public function create($folderName) { - try { - // we need to purge deleted folders if a folder is created to - // prevent already exists exceptions - $this->folderService->purgeDeleted($this->userId, false); - $folder = $this->folderService->create($folderName, $this->userId); + public function create($folderName) { + try { + // we need to purge deleted folders if a folder is created to + // prevent already exists exceptions + $this->folderService->purgeDeleted($this->userId, false); + $folder = $this->folderService->create($folderName, $this->userId); - return ['folders' => [$folder]]; + return ['folders' => [$folder]]; - } catch(ServiceConflictException $ex) { - return $this->error($ex, Http::STATUS_CONFLICT); - } catch(ServiceValidationException $ex) { - return $this->error($ex, Http::STATUS_UNPROCESSABLE_ENTITY); - } + } catch(ServiceConflictException $ex) { + return $this->error($ex, Http::STATUS_CONFLICT); + } catch(ServiceValidationException $ex) { + return $this->error($ex, Http::STATUS_UNPROCESSABLE_ENTITY); + } - } + } /** @@ -105,15 +105,15 @@ class FolderController extends Controller { * @param int $folderId * @return array|\OCP\AppFramework\Http\JSONResponse */ - public function delete($folderId) { - try { - $this->folderService->markDeleted($folderId, $this->userId); - } catch (ServiceNotFoundException $ex){ - return $this->error($ex, Http::STATUS_NOT_FOUND); - } + public function delete($folderId) { + try { + $this->folderService->markDeleted($folderId, $this->userId); + } catch (ServiceNotFoundException $ex){ + return $this->error($ex, Http::STATUS_NOT_FOUND); + } return []; - } + } /** @@ -123,22 +123,22 @@ class FolderController extends Controller { * @param int $folderId * @return array|\OCP\AppFramework\Http\JSONResponse */ - public function rename($folderName, $folderId) { - try { - $folder = $this->folderService->rename($folderId, $folderName, - $this->userId); + public function rename($folderName, $folderId) { + try { + $folder = $this->folderService->rename($folderId, $folderName, + $this->userId); - return ['folders' => [$folder]]; + return ['folders' => [$folder]]; - } catch(ServiceConflictException $ex) { - return $this->error($ex, Http::STATUS_CONFLICT); - } catch(ServiceValidationException $ex) { - return $this->error($ex, Http::STATUS_UNPROCESSABLE_ENTITY); - } catch (ServiceNotFoundException $ex){ - return $this->error($ex, Http::STATUS_NOT_FOUND); - } + } catch(ServiceConflictException $ex) { + return $this->error($ex, Http::STATUS_CONFLICT); + } catch(ServiceValidationException $ex) { + return $this->error($ex, Http::STATUS_UNPROCESSABLE_ENTITY); + } catch (ServiceNotFoundException $ex){ + return $this->error($ex, Http::STATUS_NOT_FOUND); + } - } + } /** * @NoAdminRequired @@ -147,11 +147,11 @@ class FolderController extends Controller { * @param int $highestItemId * @return array */ - public function read($folderId, $highestItemId) { - $this->itemService->readFolder($folderId, $highestItemId, $this->userId); + public function read($folderId, $highestItemId) { + $this->itemService->readFolder($folderId, $highestItemId, $this->userId); - return ['feeds' => $this->feedService->findAll($this->userId)]; - } + return ['feeds' => $this->feedService->findAll($this->userId)]; + } /** @@ -160,15 +160,15 @@ class FolderController extends Controller { * @param int $folderId * @return array|\OCP\AppFramework\Http\JSONResponse */ - public function restore($folderId) { - try { - $this->folderService->unmarkDeleted($folderId, $this->userId); - } catch (ServiceNotFoundException $ex){ - return $this->error($ex, Http::STATUS_NOT_FOUND); - } + public function restore($folderId) { + try { + $this->folderService->unmarkDeleted($folderId, $this->userId); + } catch (ServiceNotFoundException $ex){ + return $this->error($ex, Http::STATUS_NOT_FOUND); + } return []; - } + } }
\ No newline at end of file |