aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/Config
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-26 14:54:51 +0200
committerJoas Schilling <coding@schilljs.com>2020-06-26 14:54:51 +0200
commitab21d69903c4360cbce59741624b6e765e3bd35f (patch)
tree8bed2d6af0d4bfef3766e356acc570b93eb9feb3 /core/Command/Config
parented4afa55c1ccaef140ac310258ad837bf6af9557 (diff)
downloadnextcloud-server-ab21d69903c4360cbce59741624b6e765e3bd35f.tar.gz
nextcloud-server-ab21d69903c4360cbce59741624b6e765e3bd35f.zip
Add return value to all commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/Command/Config')
-rw-r--r--core/Command/Config/App/DeleteConfig.php2
-rw-r--r--core/Command/Config/App/GetConfig.php2
-rw-r--r--core/Command/Config/App/SetConfig.php2
-rw-r--r--core/Command/Config/Import.php5
-rw-r--r--core/Command/Config/ListConfigs.php3
-rw-r--r--core/Command/Config/System/DeleteConfig.php2
-rw-r--r--core/Command/Config/System/GetConfig.php2
-rw-r--r--core/Command/Config/System/SetConfig.php2
8 files changed, 11 insertions, 9 deletions
diff --git a/core/Command/Config/App/DeleteConfig.php b/core/Command/Config/App/DeleteConfig.php
index 8f8f9e66d4b..6eb1585d599 100644
--- a/core/Command/Config/App/DeleteConfig.php
+++ b/core/Command/Config/App/DeleteConfig.php
@@ -65,7 +65,7 @@ class DeleteConfig extends Base {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$configName = $input->getArgument('name');
diff --git a/core/Command/Config/App/GetConfig.php b/core/Command/Config/App/GetConfig.php
index f52461c17e4..32a83451b77 100644
--- a/core/Command/Config/App/GetConfig.php
+++ b/core/Command/Config/App/GetConfig.php
@@ -72,7 +72,7 @@ class GetConfig extends Base {
* @param OutputInterface $output An OutputInterface instance
* @return null|int null or 0 if everything went fine, or an error code
*/
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$configName = $input->getArgument('name');
$defaultValue = $input->getOption('default-value');
diff --git a/core/Command/Config/App/SetConfig.php b/core/Command/Config/App/SetConfig.php
index 393deb010e6..327eebfaeb1 100644
--- a/core/Command/Config/App/SetConfig.php
+++ b/core/Command/Config/App/SetConfig.php
@@ -71,7 +71,7 @@ class SetConfig extends Base {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$configName = $input->getArgument('name');
diff --git a/core/Command/Config/Import.php b/core/Command/Config/Import.php
index 3ff1950b765..755c6c80cd9 100644
--- a/core/Command/Config/Import.php
+++ b/core/Command/Config/Import.php
@@ -60,7 +60,7 @@ class Import extends Command implements CompletionAwareInterface {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$importFile = $input->getArgument('file');
if ($importFile !== null) {
$content = $this->getArrayFromFile($importFile);
@@ -72,7 +72,7 @@ class Import extends Command implements CompletionAwareInterface {
$configs = $this->validateFileContent($content);
} catch (\UnexpectedValueException $e) {
$output->writeln('<error>' . $e->getMessage(). '</error>');
- return;
+ return 1;
}
if (!empty($configs['system'])) {
@@ -92,6 +92,7 @@ class Import extends Command implements CompletionAwareInterface {
}
$output->writeln('<info>Config successfully imported from: ' . $importFile . '</info>');
+ return 0;
}
/**
diff --git a/core/Command/Config/ListConfigs.php b/core/Command/Config/ListConfigs.php
index 2394811f517..e73c3a4831c 100644
--- a/core/Command/Config/ListConfigs.php
+++ b/core/Command/Config/ListConfigs.php
@@ -71,7 +71,7 @@ class ListConfigs extends Base {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$app = $input->getArgument('app');
$noSensitiveValues = !$input->getOption('private');
@@ -102,6 +102,7 @@ class ListConfigs extends Base {
}
$this->writeArrayInOutputFormat($input, $output, $configs);
+ return 0;
}
/**
diff --git a/core/Command/Config/System/DeleteConfig.php b/core/Command/Config/System/DeleteConfig.php
index 9bd162f987a..8df3f934e1e 100644
--- a/core/Command/Config/System/DeleteConfig.php
+++ b/core/Command/Config/System/DeleteConfig.php
@@ -62,7 +62,7 @@ class DeleteConfig extends Base {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$configNames = $input->getArgument('name');
$configName = $configNames[0];
diff --git a/core/Command/Config/System/GetConfig.php b/core/Command/Config/System/GetConfig.php
index a1ea135e590..f01ed804de4 100644
--- a/core/Command/Config/System/GetConfig.php
+++ b/core/Command/Config/System/GetConfig.php
@@ -68,7 +68,7 @@ class GetConfig extends Base {
* @param OutputInterface $output An OutputInterface instance
* @return null|int null or 0 if everything went fine, or an error code
*/
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$configNames = $input->getArgument('name');
$configName = array_shift($configNames);
$defaultValue = $input->getOption('default-value');
diff --git a/core/Command/Config/System/SetConfig.php b/core/Command/Config/System/SetConfig.php
index 55030be545f..bcc55d746a9 100644
--- a/core/Command/Config/System/SetConfig.php
+++ b/core/Command/Config/System/SetConfig.php
@@ -77,7 +77,7 @@ class SetConfig extends Base {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$configNames = $input->getArgument('name');
$configName = $configNames[0];
$configValue = $this->castValue($input->getOption('value'), $input->getOption('type'));