Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-26 16:12:11 +0300
committerJoas Schilling <coding@schilljs.com>2020-06-26 16:12:11 +0300
commitd7c0b9cced2dff16e4e05507ac58cf8664a6aafc (patch)
treebb136f0e797986da6e789bf2bf5e9f0370002d26 /apps/files_external
parentab21d69903c4360cbce59741624b6e765e3bd35f (diff)
Also always return in app commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Command/Applicable.php3
-rw-r--r--apps/files_external/lib/Command/Backends.php3
-rw-r--r--apps/files_external/lib/Command/Config.php3
-rw-r--r--apps/files_external/lib/Command/Create.php2
-rw-r--r--apps/files_external/lib/Command/Delete.php5
-rw-r--r--apps/files_external/lib/Command/Export.php3
-rw-r--r--apps/files_external/lib/Command/Import.php2
-rw-r--r--apps/files_external/lib/Command/ListCommand.php3
-rw-r--r--apps/files_external/lib/Command/Notify.php3
-rw-r--r--apps/files_external/lib/Command/Verify.php3
10 files changed, 19 insertions, 11 deletions
diff --git a/apps/files_external/lib/Command/Applicable.php b/apps/files_external/lib/Command/Applicable.php
index 81d7f972f46..bec312bdcb2 100644
--- a/apps/files_external/lib/Command/Applicable.php
+++ b/apps/files_external/lib/Command/Applicable.php
@@ -100,7 +100,7 @@ class Applicable extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$mountId = $input->getArgument('mount_id');
try {
$mount = $this->globalService->getStorage($mountId);
@@ -154,5 +154,6 @@ class Applicable extends Base {
'users' => $applicableUsers,
'groups' => $applicableGroups
]);
+ return 0;
}
}
diff --git a/apps/files_external/lib/Command/Backends.php b/apps/files_external/lib/Command/Backends.php
index e06f5ea5fd1..3bb4b9121ae 100644
--- a/apps/files_external/lib/Command/Backends.php
+++ b/apps/files_external/lib/Command/Backends.php
@@ -59,7 +59,7 @@ class Backends extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$authBackends = $this->backendService->getAuthMechanisms();
$storageBackends = $this->backendService->getBackends();
@@ -87,6 +87,7 @@ class Backends extends Base {
}
$this->writeArrayInOutputFormat($input, $output, $data);
+ return 0;
}
private function serializeAuthBackend(\JsonSerializable $backend) {
diff --git a/apps/files_external/lib/Command/Config.php b/apps/files_external/lib/Command/Config.php
index dde74de3a9c..467f421e730 100644
--- a/apps/files_external/lib/Command/Config.php
+++ b/apps/files_external/lib/Command/Config.php
@@ -64,7 +64,7 @@ class Config extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$mountId = $input->getArgument('mount_id');
$key = $input->getArgument('key');
try {
@@ -80,6 +80,7 @@ class Config extends Base {
} else {
$this->getOption($mount, $key, $output);
}
+ return 0;
}
/**
diff --git a/apps/files_external/lib/Command/Create.php b/apps/files_external/lib/Command/Create.php
index 769ffbec51c..654c7357023 100644
--- a/apps/files_external/lib/Command/Create.php
+++ b/apps/files_external/lib/Command/Create.php
@@ -119,7 +119,7 @@ class Create extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$user = $input->getOption('user');
$mountPoint = $input->getArgument('mount_point');
$storageIdentifier = $input->getArgument('storage_backend');
diff --git a/apps/files_external/lib/Command/Delete.php b/apps/files_external/lib/Command/Delete.php
index c44e35c7fa9..71496e58d14 100644
--- a/apps/files_external/lib/Command/Delete.php
+++ b/apps/files_external/lib/Command/Delete.php
@@ -84,7 +84,7 @@ class Delete extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$mountId = $input->getArgument('mount_id');
try {
$mount = $this->globalService->getStorage($mountId);
@@ -105,10 +105,11 @@ class Delete extends Base {
$question = new ConfirmationQuestion('Delete this mount? [y/N] ', false);
if (!$questionHelper->ask($input, $output, $question)) {
- return null;
+ return 1;
}
}
$this->globalService->removeStorage($mountId);
+ return 0;
}
}
diff --git a/apps/files_external/lib/Command/Export.php b/apps/files_external/lib/Command/Export.php
index 242f408a54d..d670865f29d 100644
--- a/apps/files_external/lib/Command/Export.php
+++ b/apps/files_external/lib/Command/Export.php
@@ -45,7 +45,7 @@ class Export extends ListCommand {
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$listCommand = new ListCommand($this->globalService, $this->userService, $this->userSession, $this->userManager);
$listInput = new ArrayInput([], $listCommand->getDefinition());
$listInput->setArgument('user_id', $input->getArgument('user_id'));
@@ -54,5 +54,6 @@ class Export extends ListCommand {
$listInput->setOption('show-password', true);
$listInput->setOption('full', true);
$listCommand->execute($listInput, $output);
+ return 0;
}
}
diff --git a/apps/files_external/lib/Command/Import.php b/apps/files_external/lib/Command/Import.php
index 0e13a521441..bbaeea91c3e 100644
--- a/apps/files_external/lib/Command/Import.php
+++ b/apps/files_external/lib/Command/Import.php
@@ -107,7 +107,7 @@ class Import extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$user = $input->getOption('user');
$path = $input->getArgument('path');
if ($path === '-') {
diff --git a/apps/files_external/lib/Command/ListCommand.php b/apps/files_external/lib/Command/ListCommand.php
index 1e7598ec541..279e581f95e 100644
--- a/apps/files_external/lib/Command/ListCommand.php
+++ b/apps/files_external/lib/Command/ListCommand.php
@@ -96,7 +96,7 @@ class ListCommand extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if ($input->getOption('all')) {
/** @var $mounts StorageConfig[] */
$mounts = $this->globalService->getStorageForAllUsers();
@@ -110,6 +110,7 @@ class ListCommand extends Base {
}
$this->listMounts($userId, $mounts, $input, $output);
+ return 0;
}
/**
diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php
index 4a48a22636c..7f305008402 100644
--- a/apps/files_external/lib/Command/Notify.php
+++ b/apps/files_external/lib/Command/Notify.php
@@ -88,7 +88,7 @@ class Notify extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$mount = $this->globalService->getStorage($input->getArgument('mount_id'));
if (is_null($mount)) {
$output->writeln('<error>Mount not found</error>');
@@ -147,6 +147,7 @@ class Notify extends Base {
}
$this->markParentAsOutdated($mount->getId(), $change->getPath(), $output);
});
+ return 0;
}
private function createStorage(StorageConfig $mount) {
diff --git a/apps/files_external/lib/Command/Verify.php b/apps/files_external/lib/Command/Verify.php
index 8e1fa71cf8b..e5bfb3052ee 100644
--- a/apps/files_external/lib/Command/Verify.php
+++ b/apps/files_external/lib/Command/Verify.php
@@ -65,7 +65,7 @@ class Verify extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$mountId = $input->getArgument('mount_id');
$configInput = $input->getOption('config');
@@ -83,6 +83,7 @@ class Verify extends Base {
'code' => $mount->getStatus(),
'message' => $mount->getStatusMessage()
]);
+ return 0;
}
private function manipulateStorageConfig(StorageConfig $storage) {