Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(filesexternal): Remove unneeded 3rdparty library use #48540

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/files_external/lib/Command/Applicable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\NotFoundException;
use OCA\Files_External\Service\GlobalStoragesService;
use OCP\AppFramework\Http;
use OCP\IGroupManager;
use OCP\IUserManager;
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 {
public function __construct(
Expand Down Expand Up @@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$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 Response::HTTP_NOT_FOUND;
return Http::STATUS_NOT_FOUND;
}

if ($mount->getType() === StorageConfig::MOUNT_TYPE_PERSONAL) {
Expand All @@ -90,13 +90,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
foreach ($addUsers as $addUser) {
if (!$this->userManager->userExists($addUser)) {
$output->writeln('<error>User "' . $addUser . '" not found</error>');
return Response::HTTP_NOT_FOUND;
return Http::STATUS_NOT_FOUND;
}
}
foreach ($addGroups as $addGroup) {
if (!$this->groupManager->groupExists($addGroup)) {
$output->writeln('<error>Group "' . $addGroup . '" not found</error>');
return Response::HTTP_NOT_FOUND;
return Http::STATUS_NOT_FOUND;
}
}

Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/Command/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\NotFoundException;
use OCA\Files_External\Service\GlobalStoragesService;
use OCP\AppFramework\Http;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\Response;

class Config extends Base {
public function __construct(
Expand Down Expand Up @@ -49,7 +49,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$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 Response::HTTP_NOT_FOUND;
return Http::STATUS_NOT_FOUND;
}

$value = $input->getArgument('value');
Expand Down
6 changes: 3 additions & 3 deletions apps/files_external/lib/Command/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
use OCA\Files_External\Service\GlobalStoragesService;
use OCA\Files_External\Service\StoragesService;
use OCA\Files_External\Service\UserStoragesService;
use OCP\AppFramework\Http;
use OCP\IUserManager;
use OCP\IUserSession;
use Symfony\Component\Console\Input\ArrayInput;
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 Create extends Base {
public function __construct(
Expand Down Expand Up @@ -93,11 +93,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
if (is_null($storageBackend)) {
$output->writeln('<error>Storage backend with identifier "' . $storageIdentifier . '" not found (see `occ files_external:backends` for possible values)</error>');
return Response::HTTP_NOT_FOUND;
return Http::STATUS_NOT_FOUND;
}
if (is_null($authBackend)) {
$output->writeln('<error>Authentication backend with identifier "' . $authIdentifier . '" not found (see `occ files_external:backends` for possible values)</error>');
return Response::HTTP_NOT_FOUND;
return Http::STATUS_NOT_FOUND;
}
$supportedSchemes = array_keys($storageBackend->getAuthSchemes());
if (!in_array($authBackend->getScheme(), $supportedSchemes)) {
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/Command/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use OCA\Files_External\NotFoundException;
use OCA\Files_External\Service\GlobalStoragesService;
use OCA\Files_External\Service\UserStoragesService;
use OCP\AppFramework\Http;
use OCP\IUserManager;
use OCP\IUserSession;
use Symfony\Component\Console\Input\ArrayInput;
Expand All @@ -18,7 +19,6 @@
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 {
public function __construct(
Expand Down Expand Up @@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$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 Response::HTTP_NOT_FOUND;
return Http::STATUS_NOT_FOUND;
}

$noConfirm = $input->getOption('yes');
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/Command/Verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\NotFoundException;
use OCA\Files_External\Service\GlobalStoragesService;
use OCP\AppFramework\Http;
use OCP\Files\StorageNotAvailableException;
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 Verify extends Base {
public function __construct(
Expand Down Expand Up @@ -50,7 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$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 Response::HTTP_NOT_FOUND;
return Http::STATUS_NOT_FOUND;
}

$this->updateStorageStatus($mount, $configInput, $output);
Expand Down
Loading