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_versions/lib
parentab21d69903c4360cbce59741624b6e765e3bd35f (diff)
Also always return in app commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_versions/lib')
-rw-r--r--apps/files_versions/lib/Command/CleanUp.php4
-rw-r--r--apps/files_versions/lib/Command/ExpireVersions.php6
2 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_versions/lib/Command/CleanUp.php b/apps/files_versions/lib/Command/CleanUp.php
index d49835f2db4..d67df024a1b 100644
--- a/apps/files_versions/lib/Command/CleanUp.php
+++ b/apps/files_versions/lib/Command/CleanUp.php
@@ -61,7 +61,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)) {
foreach ($users as $user) {
@@ -70,6 +70,7 @@ class CleanUp extends Command {
$this->deleteVersions($user);
} else {
$output->writeln("<error>Unknown user $user</error>");
+ return 1;
}
}
} else {
@@ -95,6 +96,7 @@ class CleanUp extends Command {
} while (count($users) >= $limit);
}
}
+ return 0;
}
diff --git a/apps/files_versions/lib/Command/ExpireVersions.php b/apps/files_versions/lib/Command/ExpireVersions.php
index a48908dcd6b..e3b444e8f46 100644
--- a/apps/files_versions/lib/Command/ExpireVersions.php
+++ b/apps/files_versions/lib/Command/ExpireVersions.php
@@ -41,7 +41,7 @@ class ExpireVersions extends Command {
* @var Expiration
*/
private $expiration;
-
+
/**
* @var IUserManager
*/
@@ -70,7 +70,7 @@ class ExpireVersions 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.");
@@ -86,6 +86,7 @@ class ExpireVersions extends Command {
$this->expireVersionsForUser($userObject);
} else {
$output->writeln("<error>Unknown user $user</error>");
+ return 1;
}
}
} else {
@@ -98,6 +99,7 @@ class ExpireVersions extends Command {
$p->finish();
$output->writeln('');
}
+ return 0;
}
public function expireVersionsForUser(IUser $user) {