From b49c85b1e98d89f30608ff92b11f6b8d37603b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Fri, 10 Apr 2020 13:20:16 +0200 Subject: Apply php-cs-fixer fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- lib/Controller/CollectionsController.php | 6 +++--- lib/Controller/Response.php | 2 +- lib/Controller/SettingsController.php | 4 ++-- lib/Service/CollectionsService.php | 32 ++++++++++++++++---------------- lib/Service/SettingsService.php | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'lib') diff --git a/lib/Controller/CollectionsController.php b/lib/Controller/CollectionsController.php index 98250d84..0dd46a71 100644 --- a/lib/Controller/CollectionsController.php +++ b/lib/Controller/CollectionsController.php @@ -40,7 +40,7 @@ class CollectionsController extends Controller { * @param IRequest $request an instance of the request * @param CollectionsService $collectionsService */ - public function __construct(string $appName, IRequest $request, CollectionsService $collectionsService){ + public function __construct(string $appName, IRequest $request, CollectionsService $collectionsService) { parent::__construct($appName, $request); $this->collectionsService = $collectionsService; } @@ -48,7 +48,7 @@ class CollectionsController extends Controller { /** * @NoAdminRequired */ - public function getCollections(){ + public function getCollections() { return $this->generateResponse(function () { return ['collections' => $this->collectionsService->getAll()]; }); @@ -57,7 +57,7 @@ class CollectionsController extends Controller { /** * @NoAdminRequired */ - public function setVisibility($collectionID, $visibility){ + public function setVisibility($collectionID, $visibility) { return $this->generateResponse(function () use ($collectionID, $visibility) { return $this->collectionsService->setVisibility($collectionID, $visibility); }); diff --git a/lib/Controller/Response.php b/lib/Controller/Response.php index 75064e7d..9dac6506 100644 --- a/lib/Controller/Response.php +++ b/lib/Controller/Response.php @@ -27,7 +27,7 @@ use \OCP\AppFramework\Http\JSONResponse; trait Response { - protected function generateResponse (Closure $callback) { + protected function generateResponse(Closure $callback) { try { $message = [ 'status' => 'success', diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 28934031..28bab89e 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -40,7 +40,7 @@ class SettingsController extends Controller { * @param IRequest $request an instance of the request * @param SettingsService $settingsService */ - public function __construct(string $appName, IRequest $request, SettingsService $settingsService){ + public function __construct(string $appName, IRequest $request, SettingsService $settingsService) { parent::__construct($appName, $request); $this->settingsService = $settingsService; } @@ -48,7 +48,7 @@ class SettingsController extends Controller { /** * @NoAdminRequired */ - public function get(){ + public function get() { return $this->generateResponse(function () { return ['settings' => $this->settingsService->get()]; }); diff --git a/lib/Service/CollectionsService.php b/lib/Service/CollectionsService.php index 76e3a0b7..c8a91053 100644 --- a/lib/Service/CollectionsService.php +++ b/lib/Service/CollectionsService.php @@ -66,41 +66,41 @@ class CollectionsService { * @return array */ public function getAll():array { - $collections = array( - array( + $collections = [ + [ 'id' => "starred", 'displayName' => (string)$this->l10n->t('Important'), 'show' => 2, - 'icon' => 'sprt-task-star'), - array( + 'icon' => 'sprt-task-star'], + [ 'id' => "today", 'displayName' => (string)$this->l10n->t('Today'), 'show' => 2, - 'icon' => 'sprt-calendar'), - array( + 'icon' => 'sprt-calendar'], + [ 'id' => "week", 'displayName' => (string)$this->l10n->t('Week'), 'show' => 2, - 'icon' => 'sprt-calendar'), - array( + 'icon' => 'sprt-calendar'], + [ 'id' => "all", 'displayName' => (string)$this->l10n->t('All'), 'show' => 2, - 'icon' => 'sprt-all'), - array( + 'icon' => 'sprt-all'], + [ 'id' => "current", 'displayName' => (string)$this->l10n->t('Current'), 'show' => 2, - 'icon' => 'sprt-current'), - array( + 'icon' => 'sprt-current'], + [ 'id' => "completed", 'displayName' => (string)$this->l10n->t('Completed'), 'show' => 2, - 'icon' => 'sprt-checkmark') - ); + 'icon' => 'sprt-checkmark'] + ]; foreach ($collections as $key => $collection){ $tmp = $this->settings->getUserValue($this->userId, $this->appName,'show_'.$collection['id']); - if (!in_array($tmp, array('0','1','2'))) { + if (!in_array($tmp, ['0','1','2'])) { $this->settings->setUserValue($this->userId, $this->appName,'show_'.$collection['id'],$collections[$key]['show']); } else { $collections[$key]['show'] = (int)$tmp; @@ -117,7 +117,7 @@ class CollectionsService { * @return bool */ public function setVisibility(string $collectionID, int $visibility):bool { - if (in_array($visibility, array(0,1,2))){ + if (in_array($visibility, [0,1,2])){ $this->settings->setUserValue($this->userId, $this->appName,'show_'.$collectionID,$visibility); } return true; diff --git a/lib/Service/SettingsService.php b/lib/Service/SettingsService.php index 5788173c..1c5bd0da 100644 --- a/lib/Service/SettingsService.php +++ b/lib/Service/SettingsService.php @@ -58,14 +58,14 @@ class SettingsService { * @return array */ public function get():array { - $settings = array( + $settings = [ 'defaultCalendarId' => (string)$this->settings->getUserValue($this->userId, $this->appName,'various_defaultCalendarId'), 'showHidden' => (int)$this->settings->getUserValue($this->userId, $this->appName,'various_showHidden'), 'sortOrder' => (string)$this->settings->getUserValue($this->userId, $this->appName,'various_sortOrder'), 'sortDirection' => (bool)$this->settings->getUserValue($this->userId, $this->appName,'various_sortDirection'), 'allDay' => (bool)$this->settings->getUserValue($this->userId, $this->appName,'various_allDay'), 'userID' => $this->userId - ); + ]; return $settings; } -- cgit v1.2.3