summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Command/Applicable.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Command/Applicable.php')
-rw-r--r--apps/files_external/lib/Command/Applicable.php24
1 files changed, 9 insertions, 15 deletions
diff --git a/apps/files_external/lib/Command/Applicable.php b/apps/files_external/lib/Command/Applicable.php
index a3708602dff..dbedc72825c 100644
--- a/apps/files_external/lib/Command/Applicable.php
+++ b/apps/files_external/lib/Command/Applicable.php
@@ -34,21 +34,15 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\HttpFoundation\Response;
class Applicable extends Base {
- protected GlobalStoragesService $globalService;
- private IUserManager $userManager;
- private IGroupManager $groupManager;
-
public function __construct(
- GlobalStoragesService $globalService,
- IUserManager $userManager,
- IGroupManager $groupManager
+ protected GlobalStoragesService $globalService,
+ private IUserManager $userManager,
+ private IGroupManager $groupManager,
) {
parent::__construct();
- $this->globalService = $globalService;
- $this->userManager = $userManager;
- $this->groupManager = $groupManager;
}
protected function configure(): void {
@@ -94,12 +88,12 @@ class Applicable 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;
}
if ($mount->getType() === StorageConfig::MOUNT_TYPE_PERSONAl) {
$output->writeln('<error>Can\'t change applicables on personal mounts</error>');
- return 1;
+ return self::FAILURE;
}
$addUsers = $input->getOption('add-user');
@@ -114,13 +108,13 @@ class Applicable extends Base {
foreach ($addUsers as $addUser) {
if (!$this->userManager->userExists($addUser)) {
$output->writeln('<error>User "' . $addUser . '" not found</error>');
- return 404;
+ return Response::HTTP_NOT_FOUND;
}
}
foreach ($addGroups as $addGroup) {
if (!$this->groupManager->groupExists($addGroup)) {
$output->writeln('<error>Group "' . $addGroup . '" not found</error>');
- return 404;
+ return Response::HTTP_NOT_FOUND;
}
}
@@ -142,6 +136,6 @@ class Applicable extends Base {
'users' => $applicableUsers,
'groups' => $applicableGroups
]);
- return 0;
+ return self::SUCCESS;
}
}