Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRaimund Schlüßler <raimund.schluessler@mailbox.org>2020-04-10 14:20:16 +0300
committerRaimund Schlüßler <raimund.schluessler@mailbox.org>2020-04-10 14:45:54 +0300
commitb49c85b1e98d89f30608ff92b11f6b8d37603b97 (patch)
tree664bdd963e1b51238ff39badebc0b6e815c2066e /lib
parente8213d582c76f0dc721d4e4b0b60d402c5c67212 (diff)
Apply php-cs-fixer fixes
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/CollectionsController.php6
-rw-r--r--lib/Controller/Response.php2
-rw-r--r--lib/Controller/SettingsController.php4
-rw-r--r--lib/Service/CollectionsService.php32
-rw-r--r--lib/Service/SettingsService.php4
5 files changed, 24 insertions, 24 deletions
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;
}