aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Command/DeleteCalendar.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Command/DeleteCalendar.php')
-rw-r--r--apps/dav/lib/Command/DeleteCalendar.php64
1 files changed, 11 insertions, 53 deletions
diff --git a/apps/dav/lib/Command/DeleteCalendar.php b/apps/dav/lib/Command/DeleteCalendar.php
index dd5f11c740f..f6dbed856e6 100644
--- a/apps/dav/lib/Command/DeleteCalendar.php
+++ b/apps/dav/lib/Command/DeleteCalendar.php
@@ -2,24 +2,8 @@
declare(strict_types=1);
/**
- *
- * @copyright Copyright (c) 2021, Mattia Narducci (mattianarducci1@gmail.com)
- *
- * @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 <https://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Command;
@@ -38,40 +22,14 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class DeleteCalendar extends Command {
- /** @var CalDavBackend */
- private $calDav;
-
- /** @var IConfig */
- private $config;
-
- /** @var IL10N */
- private $l10n;
-
- /** @var IUserManager */
- private $userManager;
-
- /** @var LoggerInterface */
- private $logger;
-
- /**
- * @param CalDavBackend $calDav
- * @param IConfig $config
- * @param IL10N $l10n
- * @param IUserManager $userManager
- */
public function __construct(
- CalDavBackend $calDav,
- IConfig $config,
- IL10N $l10n,
- IUserManager $userManager,
- LoggerInterface $logger
+ private CalDavBackend $calDav,
+ private IConfig $config,
+ private IL10N $l10n,
+ private IUserManager $userManager,
+ private LoggerInterface $logger,
) {
parent::__construct();
- $this->calDav = $calDav;
- $this->config = $config;
- $this->l10n = $l10n;
- $this->userManager = $userManager;
- $this->logger = $logger;
}
protected function configure(): void {
@@ -96,9 +54,9 @@ class DeleteCalendar extends Command {
protected function execute(
InputInterface $input,
- OutputInterface $output
+ OutputInterface $output,
): int {
- /** @var string $user **/
+ /** @var string $user */
$user = $input->getArgument('uid');
if (!$this->userManager->userExists($user)) {
throw new \InvalidArgumentException(
@@ -109,7 +67,7 @@ class DeleteCalendar extends Command {
if ($birthday !== false) {
$name = BirthdayService::BIRTHDAY_CALENDAR_URI;
} else {
- /** @var string $name **/
+ /** @var string $name */
$name = $input->getArgument('name');
if (!$name) {
throw new \InvalidArgumentException(
@@ -140,6 +98,6 @@ class DeleteCalendar extends Command {
$calendar->delete();
- return 0;
+ return self::SUCCESS;
}
}