diff options
Diffstat (limited to 'apps/files_versions/lib/Command')
-rw-r--r-- | apps/files_versions/lib/Command/CleanUp.php | 4 | ||||
-rw-r--r-- | apps/files_versions/lib/Command/ExpireVersions.php | 6 |
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) { |