diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-26 15:12:11 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-06-26 15:12:11 +0200 |
commit | d7c0b9cced2dff16e4e05507ac58cf8664a6aafc (patch) | |
tree | bb136f0e797986da6e789bf2bf5e9f0370002d26 /apps/dav/lib | |
parent | ab21d69903c4360cbce59741624b6e765e3bd35f (diff) | |
download | nextcloud-server-d7c0b9cced2dff16e4e05507ac58cf8664a6aafc.tar.gz nextcloud-server-d7c0b9cced2dff16e4e05507ac58cf8664a6aafc.zip |
Also always return in app commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/Command/CreateAddressBook.php | 3 | ||||
-rw-r--r-- | apps/dav/lib/Command/CreateCalendar.php | 3 | ||||
-rw-r--r-- | apps/dav/lib/Command/ListCalendars.php | 3 | ||||
-rw-r--r-- | apps/dav/lib/Command/MoveCalendar.php | 3 | ||||
-rw-r--r-- | apps/dav/lib/Command/RemoveInvalidShares.php | 3 | ||||
-rw-r--r-- | apps/dav/lib/Command/SendEventReminders.php | 7 | ||||
-rw-r--r-- | apps/dav/lib/Command/SyncBirthdayCalendar.php | 5 | ||||
-rw-r--r-- | apps/dav/lib/Command/SyncSystemAddressBook.php | 3 |
8 files changed, 19 insertions, 11 deletions
diff --git a/apps/dav/lib/Command/CreateAddressBook.php b/apps/dav/lib/Command/CreateAddressBook.php index 317b356772e..6bd175f91d3 100644 --- a/apps/dav/lib/Command/CreateAddressBook.php +++ b/apps/dav/lib/Command/CreateAddressBook.php @@ -64,7 +64,7 @@ class CreateAddressBook extends Command { 'Name of the addressbook'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $user = $input->getArgument('user'); if (!$this->userManager->userExists($user)) { throw new \InvalidArgumentException("User <$user> in unknown."); @@ -72,5 +72,6 @@ class CreateAddressBook extends Command { $name = $input->getArgument('name'); $this->cardDavBackend->createAddressBook("principals/users/$user", $name, []); + return 0; } } diff --git a/apps/dav/lib/Command/CreateCalendar.php b/apps/dav/lib/Command/CreateCalendar.php index 81a8773957a..d03b573e4ab 100644 --- a/apps/dav/lib/Command/CreateCalendar.php +++ b/apps/dav/lib/Command/CreateCalendar.php @@ -73,7 +73,7 @@ class CreateCalendar extends Command { 'Name of the calendar'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $user = $input->getArgument('user'); if (!$this->userManager->userExists($user)) { throw new \InvalidArgumentException("User <$user> in unknown."); @@ -94,5 +94,6 @@ class CreateCalendar extends Command { $name = $input->getArgument('name'); $caldav = new CalDavBackend($this->dbConnection, $principalBackend, $this->userManager, $this->groupManager, $random, $logger, $dispatcher); $caldav->createCalendar("principals/users/$user", $name, []); + return 0; } } diff --git a/apps/dav/lib/Command/ListCalendars.php b/apps/dav/lib/Command/ListCalendars.php index 85aa25be946..422202d9227 100644 --- a/apps/dav/lib/Command/ListCalendars.php +++ b/apps/dav/lib/Command/ListCalendars.php @@ -62,7 +62,7 @@ class ListCalendars extends Command { 'User for whom all calendars will be listed'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $user = $input->getArgument('uid'); if (!$this->userManager->userExists($user)) { throw new \InvalidArgumentException("User <$user> is unknown."); @@ -101,5 +101,6 @@ class ListCalendars extends Command { } else { $output->writeln("<info>User <$user> has no calendars</info>"); } + return 0; } } diff --git a/apps/dav/lib/Command/MoveCalendar.php b/apps/dav/lib/Command/MoveCalendar.php index d40f4600745..b89c64d7ba7 100644 --- a/apps/dav/lib/Command/MoveCalendar.php +++ b/apps/dav/lib/Command/MoveCalendar.php @@ -106,7 +106,7 @@ class MoveCalendar extends Command { ->addOption('force', 'f', InputOption::VALUE_NONE, "Force the migration by removing existing shares"); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $userOrigin = $input->getArgument('sourceuid'); $userDestination = $input->getArgument('destinationuid'); @@ -137,6 +137,7 @@ class MoveCalendar extends Command { $this->calDav->moveCalendar($name, self::URI_USERS . $userOrigin, self::URI_USERS . $userDestination); $this->io->success("Calendar <$name> was moved from user <$userOrigin> to <$userDestination>"); + return 0; } /** diff --git a/apps/dav/lib/Command/RemoveInvalidShares.php b/apps/dav/lib/Command/RemoveInvalidShares.php index 71644456f67..0129191c18b 100644 --- a/apps/dav/lib/Command/RemoveInvalidShares.php +++ b/apps/dav/lib/Command/RemoveInvalidShares.php @@ -57,7 +57,7 @@ class RemoveInvalidShares extends Command { ->setDescription('Remove invalid dav shares'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $query = $this->connection->getQueryBuilder(); $result = $query->selectDistinct('principaluri') ->from('dav_shares') @@ -72,6 +72,7 @@ class RemoveInvalidShares extends Command { } $result->closeCursor(); + return 0; } /** diff --git a/apps/dav/lib/Command/SendEventReminders.php b/apps/dav/lib/Command/SendEventReminders.php index 8313f265bfc..3eb7f1a56ee 100644 --- a/apps/dav/lib/Command/SendEventReminders.php +++ b/apps/dav/lib/Command/SendEventReminders.php @@ -67,19 +67,20 @@ class SendEventReminders extends Command { * @param InputInterface $input * @param OutputInterface $output */ - protected function execute(InputInterface $input, OutputInterface $output):void { + protected function execute(InputInterface $input, OutputInterface $output): int { if ($this->config->getAppValue('dav', 'sendEventReminders', 'yes') !== 'yes') { $output->writeln('<error>Sending event reminders disabled!</error>'); $output->writeln('<info>Please run "php occ config:app:set dav sendEventReminders --value yes"'); - return; + return 1; } if ($this->config->getAppValue('dav', 'sendEventRemindersMode', 'backgroundjob') !== 'occ') { $output->writeln('<error>Sending event reminders mode set to background-job!</error>'); $output->writeln('<info>Please run "php occ config:app:set dav sendEventRemindersMode --value occ"'); - return; + return 1; } $this->reminderService->processReminders(); + return 0; } } diff --git a/apps/dav/lib/Command/SyncBirthdayCalendar.php b/apps/dav/lib/Command/SyncBirthdayCalendar.php index 0addbc08a73..6536f8439a4 100644 --- a/apps/dav/lib/Command/SyncBirthdayCalendar.php +++ b/apps/dav/lib/Command/SyncBirthdayCalendar.php @@ -73,7 +73,7 @@ class SyncBirthdayCalendar extends Command { * @param InputInterface $input * @param OutputInterface $output */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $this->verifyEnabled(); $user = $input->getArgument('user'); @@ -91,7 +91,7 @@ class SyncBirthdayCalendar extends Command { $output->writeln("Start birthday calendar sync for $user"); $this->birthdayService->syncUser($user); - return; + return 0; } $output->writeln("Start birthday calendar sync for all users ..."); $p = new ProgressBar($output); @@ -111,6 +111,7 @@ class SyncBirthdayCalendar extends Command { $p->finish(); $output->writeln(''); + return 0; } protected function verifyEnabled() { diff --git a/apps/dav/lib/Command/SyncSystemAddressBook.php b/apps/dav/lib/Command/SyncSystemAddressBook.php index 26cb0aa6439..9fabc6de883 100644 --- a/apps/dav/lib/Command/SyncSystemAddressBook.php +++ b/apps/dav/lib/Command/SyncSystemAddressBook.php @@ -53,7 +53,7 @@ class SyncSystemAddressBook extends Command { * @param InputInterface $input * @param OutputInterface $output */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln('Syncing users ...'); $progress = new ProgressBar($output); $progress->start(); @@ -63,5 +63,6 @@ class SyncSystemAddressBook extends Command { $progress->finish(); $output->writeln(''); + return 0; } } |