summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-26 15:12:11 +0200
committerJoas Schilling <coding@schilljs.com>2020-06-26 15:12:11 +0200
commitd7c0b9cced2dff16e4e05507ac58cf8664a6aafc (patch)
treebb136f0e797986da6e789bf2bf5e9f0370002d26 /apps/files_trashbin/lib
parentab21d69903c4360cbce59741624b6e765e3bd35f (diff)
downloadnextcloud-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_trashbin/lib')
-rw-r--r--apps/files_trashbin/lib/Command/CleanUp.php4
-rw-r--r--apps/files_trashbin/lib/Command/ExpireTrash.php8
2 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_trashbin/lib/Command/CleanUp.php b/apps/files_trashbin/lib/Command/CleanUp.php
index 7192ed26094..1b61c1ae74d 100644
--- a/apps/files_trashbin/lib/Command/CleanUp.php
+++ b/apps/files_trashbin/lib/Command/CleanUp.php
@@ -77,7 +77,7 @@ class CleanUp extends Command {
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$users = $input->getArgument('user_id');
if ((!empty($users)) and ($input->getOption('all-users'))) {
throw new InvalidOptionException('Either specify a user_id or --all-users');
@@ -88,6 +88,7 @@ class CleanUp extends Command {
$this->removeDeletedFiles($user);
} else {
$output->writeln("<error>Unknown user $user</error>");
+ return 1;
}
}
} elseif ($input->getOption('all-users')) {
@@ -112,6 +113,7 @@ class CleanUp extends Command {
} else {
throw new InvalidOptionException('Either specify a user_id or --all-users');
}
+ return 0;
}
/**
diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php
index 7cc6c83b369..26088aad37d 100644
--- a/apps/files_trashbin/lib/Command/ExpireTrash.php
+++ b/apps/files_trashbin/lib/Command/ExpireTrash.php
@@ -42,7 +42,7 @@ class ExpireTrash extends Command {
* @var Expiration
*/
private $expiration;
-
+
/**
* @var IUserManager
*/
@@ -71,11 +71,11 @@ class ExpireTrash extends Command {
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$maxAge = $this->expiration->getMaxAgeAsTimestamp();
if (!$maxAge) {
$output->writeln("No expiry configured.");
- return;
+ return 1;
}
$users = $input->getArgument('user_id');
@@ -87,6 +87,7 @@ class ExpireTrash extends Command {
$this->expireTrashForUser($userObject);
} else {
$output->writeln("<error>Unknown user $user</error>");
+ return 1;
}
}
} else {
@@ -99,6 +100,7 @@ class ExpireTrash extends Command {
$p->finish();
$output->writeln('');
}
+ return 0;
}
public function expireTrashForUser(IUser $user) {