Skip to content

Commit bfcf4dc

Browse files
Merge pull request #48540 from nextcloud/bugfix/noid/remove-3rdparty-use
fix(filesexternal): Remove unneeded 3rdparty library use
2 parents 6c14c93 + 96f77d7 commit bfcf4dc

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

apps/files_external/lib/Command/Applicable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
use OCA\Files_External\Lib\StorageConfig;
1111
use OCA\Files_External\NotFoundException;
1212
use OCA\Files_External\Service\GlobalStoragesService;
13+
use OCP\AppFramework\Http;
1314
use OCP\IGroupManager;
1415
use OCP\IUserManager;
1516
use Symfony\Component\Console\Input\InputArgument;
1617
use Symfony\Component\Console\Input\InputInterface;
1718
use Symfony\Component\Console\Input\InputOption;
1819
use Symfony\Component\Console\Output\OutputInterface;
19-
use Symfony\Component\HttpFoundation\Response;
2020

2121
class Applicable extends Base {
2222
public function __construct(
@@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7070
$mount = $this->globalService->getStorage($mountId);
7171
} catch (NotFoundException $e) {
7272
$output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts</error>');
73-
return Response::HTTP_NOT_FOUND;
73+
return Http::STATUS_NOT_FOUND;
7474
}
7575

7676
if ($mount->getType() === StorageConfig::MOUNT_TYPE_PERSONAL) {
@@ -90,13 +90,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9090
foreach ($addUsers as $addUser) {
9191
if (!$this->userManager->userExists($addUser)) {
9292
$output->writeln('<error>User "' . $addUser . '" not found</error>');
93-
return Response::HTTP_NOT_FOUND;
93+
return Http::STATUS_NOT_FOUND;
9494
}
9595
}
9696
foreach ($addGroups as $addGroup) {
9797
if (!$this->groupManager->groupExists($addGroup)) {
9898
$output->writeln('<error>Group "' . $addGroup . '" not found</error>');
99-
return Response::HTTP_NOT_FOUND;
99+
return Http::STATUS_NOT_FOUND;
100100
}
101101
}
102102

apps/files_external/lib/Command/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
use OCA\Files_External\Lib\StorageConfig;
1111
use OCA\Files_External\NotFoundException;
1212
use OCA\Files_External\Service\GlobalStoragesService;
13+
use OCP\AppFramework\Http;
1314
use Symfony\Component\Console\Input\InputArgument;
1415
use Symfony\Component\Console\Input\InputInterface;
1516
use Symfony\Component\Console\Output\OutputInterface;
16-
use Symfony\Component\HttpFoundation\Response;
1717

1818
class Config extends Base {
1919
public function __construct(
@@ -49,7 +49,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4949
$mount = $this->globalService->getStorage($mountId);
5050
} catch (NotFoundException $e) {
5151
$output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"</error>');
52-
return Response::HTTP_NOT_FOUND;
52+
return Http::STATUS_NOT_FOUND;
5353
}
5454

5555
$value = $input->getArgument('value');

apps/files_external/lib/Command/Create.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
use OCA\Files_External\Service\GlobalStoragesService;
1818
use OCA\Files_External\Service\StoragesService;
1919
use OCA\Files_External\Service\UserStoragesService;
20+
use OCP\AppFramework\Http;
2021
use OCP\IUserManager;
2122
use OCP\IUserSession;
2223
use Symfony\Component\Console\Input\ArrayInput;
2324
use Symfony\Component\Console\Input\InputArgument;
2425
use Symfony\Component\Console\Input\InputInterface;
2526
use Symfony\Component\Console\Input\InputOption;
2627
use Symfony\Component\Console\Output\OutputInterface;
27-
use Symfony\Component\HttpFoundation\Response;
2828

2929
class Create extends Base {
3030
public function __construct(
@@ -93,11 +93,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9393
}
9494
if (is_null($storageBackend)) {
9595
$output->writeln('<error>Storage backend with identifier "' . $storageIdentifier . '" not found (see `occ files_external:backends` for possible values)</error>');
96-
return Response::HTTP_NOT_FOUND;
96+
return Http::STATUS_NOT_FOUND;
9797
}
9898
if (is_null($authBackend)) {
9999
$output->writeln('<error>Authentication backend with identifier "' . $authIdentifier . '" not found (see `occ files_external:backends` for possible values)</error>');
100-
return Response::HTTP_NOT_FOUND;
100+
return Http::STATUS_NOT_FOUND;
101101
}
102102
$supportedSchemes = array_keys($storageBackend->getAuthSchemes());
103103
if (!in_array($authBackend->getScheme(), $supportedSchemes)) {

apps/files_external/lib/Command/Delete.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use OCA\Files_External\NotFoundException;
1111
use OCA\Files_External\Service\GlobalStoragesService;
1212
use OCA\Files_External\Service\UserStoragesService;
13+
use OCP\AppFramework\Http;
1314
use OCP\IUserManager;
1415
use OCP\IUserSession;
1516
use Symfony\Component\Console\Input\ArrayInput;
@@ -18,7 +19,6 @@
1819
use Symfony\Component\Console\Input\InputOption;
1920
use Symfony\Component\Console\Output\OutputInterface;
2021
use Symfony\Component\Console\Question\ConfirmationQuestion;
21-
use Symfony\Component\HttpFoundation\Response;
2222

2323
class Delete extends Base {
2424
public function __construct(
@@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5353
$mount = $this->globalService->getStorage($mountId);
5454
} catch (NotFoundException $e) {
5555
$output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"</error>');
56-
return Response::HTTP_NOT_FOUND;
56+
return Http::STATUS_NOT_FOUND;
5757
}
5858

5959
$noConfirm = $input->getOption('yes');

apps/files_external/lib/Command/Verify.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
use OCA\Files_External\Lib\StorageConfig;
1212
use OCA\Files_External\NotFoundException;
1313
use OCA\Files_External\Service\GlobalStoragesService;
14+
use OCP\AppFramework\Http;
1415
use OCP\Files\StorageNotAvailableException;
1516
use Symfony\Component\Console\Input\InputArgument;
1617
use Symfony\Component\Console\Input\InputInterface;
1718
use Symfony\Component\Console\Input\InputOption;
1819
use Symfony\Component\Console\Output\OutputInterface;
19-
use Symfony\Component\HttpFoundation\Response;
2020

2121
class Verify extends Base {
2222
public function __construct(
@@ -50,7 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5050
$mount = $this->globalService->getStorage($mountId);
5151
} catch (NotFoundException $e) {
5252
$output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"</error>');
53-
return Response::HTTP_NOT_FOUND;
53+
return Http::STATUS_NOT_FOUND;
5454
}
5555

5656
$this->updateStorageStatus($mount, $configInput, $output);

0 commit comments

Comments
 (0)