diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-26 15:12:11 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-06-26 15:12:11 +0200 |
commit | d7c0b9cced2dff16e4e05507ac58cf8664a6aafc (patch) | |
tree | bb136f0e797986da6e789bf2bf5e9f0370002d26 /apps/files/lib | |
parent | ab21d69903c4360cbce59741624b6e765e3bd35f (diff) | |
download | nextcloud-server-d7c0b9cced2dff16e4e05507ac58cf8664a6aafc.tar.gz nextcloud-server-d7c0b9cced2dff16e4e05507ac58cf8664a6aafc.zip |
Also always return in app commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Command/DeleteOrphanedFiles.php | 3 | ||||
-rw-r--r-- | apps/files/lib/Command/Scan.php | 5 | ||||
-rw-r--r-- | apps/files/lib/Command/ScanAppData.php | 2 | ||||
-rw-r--r-- | apps/files/lib/Command/TransferOwnership.php | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/apps/files/lib/Command/DeleteOrphanedFiles.php b/apps/files/lib/Command/DeleteOrphanedFiles.php index 167d679e3c8..c8ce9729ef7 100644 --- a/apps/files/lib/Command/DeleteOrphanedFiles.php +++ b/apps/files/lib/Command/DeleteOrphanedFiles.php @@ -51,7 +51,7 @@ class DeleteOrphanedFiles extends Command { ->setDescription('cleanup filecache'); } - public function execute(InputInterface $input, OutputInterface $output) { + public function execute(InputInterface $input, OutputInterface $output): int { $deletedEntries = 0; $query = $this->connection->getQueryBuilder(); @@ -78,5 +78,6 @@ class DeleteOrphanedFiles extends Command { } $output->writeln("$deletedEntries orphaned file cache entries deleted"); + return 0; } } diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index c75073e428f..aea6003417d 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -169,7 +169,7 @@ class Scan extends Base { return substr_count($mountPoint->getMountPoint(), '/') <= 3; } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $inputPath = $input->getOption('path'); if ($inputPath) { $inputPath = '/' . trim($inputPath, '/'); @@ -190,7 +190,7 @@ class Scan extends Base { $users_total = count($users); if ($users_total === 0) { $output->writeln('<error>Please specify the user id to scan, --all to scan for all users or --path=...</error>'); - return; + return 1; } $this->initTools(); @@ -219,6 +219,7 @@ class Scan extends Base { } $this->presentStats($output); + return 0; } /** diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php index 47cd81e6b4e..47a153d3895 100644 --- a/apps/files/lib/Command/ScanAppData.php +++ b/apps/files/lib/Command/ScanAppData.php @@ -149,7 +149,7 @@ class ScanAppData extends Base { } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { # restrict the verbosity level to VERBOSITY_VERBOSE if ($output->getVerbosity() > OutputInterface::VERBOSITY_VERBOSE) { $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); diff --git a/apps/files/lib/Command/TransferOwnership.php b/apps/files/lib/Command/TransferOwnership.php index b1d90452c23..92d8fba8f27 100644 --- a/apps/files/lib/Command/TransferOwnership.php +++ b/apps/files/lib/Command/TransferOwnership.php @@ -86,7 +86,7 @@ class TransferOwnership extends Command { ); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $sourceUserObject = $this->userManager->get($input->getArgument('source-user')); $destinationUserObject = $this->userManager->get($input->getArgument('destination-user')); |