aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Command/Delete.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Command/Delete.php')
-rw-r--r--apps/files_external/lib/Command/Delete.php46
1 files changed, 13 insertions, 33 deletions
diff --git a/apps/files_external/lib/Command/Delete.php b/apps/files_external/lib/Command/Delete.php
index cf09e3907b7..077b969d7b2 100644
--- a/apps/files_external/lib/Command/Delete.php
+++ b/apps/files_external/lib/Command/Delete.php
@@ -1,25 +1,8 @@
<?php
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * 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, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\Files_External\Command;
@@ -35,19 +18,16 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
+use Symfony\Component\HttpFoundation\Response;
class Delete extends Base {
- protected GlobalStoragesService $globalService;
- protected UserStoragesService $userService;
- protected IUserSession $userSession;
- protected IUserManager $userManager;
-
- public function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserSession $userSession, IUserManager $userManager) {
+ public function __construct(
+ protected GlobalStoragesService $globalService,
+ protected UserStoragesService $userService,
+ protected IUserSession $userSession,
+ protected IUserManager $userManager,
+ ) {
parent::__construct();
- $this->globalService = $globalService;
- $this->userService = $userService;
- $this->userSession = $userSession;
- $this->userManager = $userManager;
}
protected function configure(): void {
@@ -73,7 +53,7 @@ class Delete extends Base {
$mount = $this->globalService->getStorage($mountId);
} catch (NotFoundException $e) {
$output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"</error>');
- return 404;
+ return Response::HTTP_NOT_FOUND;
}
$noConfirm = $input->getOption('yes');
@@ -88,11 +68,11 @@ class Delete extends Base {
$question = new ConfirmationQuestion('Delete this mount? [y/N] ', false);
if (!$questionHelper->ask($input, $output, $question)) {
- return 1;
+ return self::FAILURE;
}
}
$this->globalService->removeStorage($mountId);
- return 0;
+ return self::SUCCESS;
}
}