aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Command/ListCalendars.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Command/ListCalendars.php')
-rw-r--r--apps/dav/lib/Command/ListCalendars.php49
1 files changed, 10 insertions, 39 deletions
diff --git a/apps/dav/lib/Command/ListCalendars.php b/apps/dav/lib/Command/ListCalendars.php
index 35581c2d4b2..408a7e5247f 100644
--- a/apps/dav/lib/Command/ListCalendars.php
+++ b/apps/dav/lib/Command/ListCalendars.php
@@ -1,27 +1,8 @@
<?php
+
/**
- * @copyright Copyright (c) 2018, Georg Ehrke
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Georg Ehrke <oc.list@georgehrke.com>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Thomas Citharel <nextcloud@tcit.fr>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Command;
@@ -35,24 +16,14 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ListCalendars extends Command {
-
- /** @var IUserManager */
- protected $userManager;
-
- /** @var CalDavBackend */
- private $caldav;
-
- /**
- * @param IUserManager $userManager
- * @param CalDavBackend $caldav
- */
- public function __construct(IUserManager $userManager, CalDavBackend $caldav) {
+ public function __construct(
+ protected IUserManager $userManager,
+ private CalDavBackend $caldav,
+ ) {
parent::__construct();
- $this->userManager = $userManager;
- $this->caldav = $caldav;
}
- protected function configure() {
+ protected function configure(): void {
$this
->setName('dav:list-calendars')
->setDescription('List all calendars of a user')
@@ -93,13 +64,13 @@ class ListCalendars extends Command {
if (count($calendarTableData) > 0) {
$table = new Table($output);
- $table->setHeaders(['uri', 'displayname', 'owner\'s userid', 'owner\'s displayname', 'writable'])
+ $table->setHeaders(['URI', 'Displayname', 'Owner principal', 'Owner displayname', 'Writable'])
->setRows($calendarTableData);
$table->render();
} else {
$output->writeln("<info>User <$user> has no calendars</info>");
}
- return 0;
+ return self::SUCCESS;
}
}