summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Command/Create.php
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-10-17 00:54:00 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-10-17 10:58:25 +0200
commit2d75321c2360fb20bf3705ef0b6c82ab320cc3ae (patch)
tree861f41190a5905c2ed50ed9b75fb5bafb982acf7 /apps/files_external/lib/Command/Create.php
parentcf1381a6f995fb2196a37253dd46dbf6d34a920a (diff)
downloadnextcloud-server-2d75321c2360fb20bf3705ef0b6c82ab320cc3ae.tar.gz
nextcloud-server-2d75321c2360fb20bf3705ef0b6c82ab320cc3ae.zip
Add more typing to FilesExternal commands
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/files_external/lib/Command/Create.php')
-rw-r--r--apps/files_external/lib/Command/Create.php33
1 files changed, 9 insertions, 24 deletions
diff --git a/apps/files_external/lib/Command/Create.php b/apps/files_external/lib/Command/Create.php
index 99991b893cd..372fa4ef372 100644
--- a/apps/files_external/lib/Command/Create.php
+++ b/apps/files_external/lib/Command/Create.php
@@ -43,26 +43,11 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Create extends Base {
- /**
- * @var GlobalStoragesService
- */
- private $globalService;
-
- /**
- * @var UserStoragesService
- */
- private $userService;
-
- /**
- * @var IUserManager
- */
- private $userManager;
-
- /** @var BackendService */
- private $backendService;
-
- /** @var IUserSession */
- private $userSession;
+ private GlobalStoragesService $globalService;
+ private UserStoragesService $userService;
+ private IUserManager $userManager;
+ private BackendService $backendService;
+ private IUserSession $userSession;
public function __construct(GlobalStoragesService $globalService,
UserStoragesService $userService,
@@ -78,7 +63,7 @@ class Create extends Base {
$this->backendService = $backendService;
}
- protected function configure() {
+ protected function configure(): void {
$this
->setName('files_external:create')
->setDescription('Create a new mount configuration')
@@ -187,7 +172,7 @@ class Create extends Base {
return 0;
}
- private function validateParam($key, &$value, Backend $storageBackend, AuthMechanism $authBackend) {
+ private function validateParam($key, &$value, Backend $storageBackend, AuthMechanism $authBackend): bool {
$params = array_merge($storageBackend->getParameters(), $authBackend->getParameters());
foreach ($params as $param) {
/** @var DefinitionParameter $param */
@@ -201,7 +186,7 @@ class Create extends Base {
return false;
}
- private function showMount($user, StorageConfig $mount, InputInterface $input, OutputInterface $output) {
+ private function showMount($user, StorageConfig $mount, InputInterface $input, OutputInterface $output): void {
$listCommand = new ListCommand($this->globalService, $this->userService, $this->userSession, $this->userManager);
$listInput = new ArrayInput([], $listCommand->getDefinition());
$listInput->setOption('output', $input->getOption('output'));
@@ -209,7 +194,7 @@ class Create extends Base {
$listCommand->listMounts($user, [$mount], $listInput, $output);
}
- protected function getStorageService($userId) {
+ protected function getStorageService(string $userId) {
if (!empty($userId)) {
$user = $this->userManager->get($userId);
if (is_null($user)) {