Merge pull request #39184 from shdehnavi/refactor_core_command_background

This commit is contained in:
John Molakvoæ 2024-02-23 21:44:18 +01:00 committed by GitHub
commit 7cf3172f1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 5 deletions

View file

@ -26,7 +26,7 @@
namespace OC\Core\Command\Background;
class Ajax extends Base {
protected function getMode() {
protected function getMode(): string {
return 'ajax';
}
}

View file

@ -45,7 +45,7 @@ abstract class Base extends Command {
parent::__construct();
}
protected function configure() {
protected function configure(): void {
$mode = $this->getMode();
$this
->setName("background:$mode")
@ -59,6 +59,7 @@ abstract class Base extends Command {
*
* @param InputInterface $input
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output): int {
$mode = $this->getMode();

View file

@ -26,7 +26,7 @@
namespace OC\Core\Command\Background;
class Cron extends Base {
protected function getMode() {
protected function getMode(): string {
return 'cron';
}
}

View file

@ -102,7 +102,7 @@ class Job extends Command {
return 0;
}
protected function printJobInfo(int $jobId, IJob $job, OutputInterface$output): void {
protected function printJobInfo(int $jobId, IJob $job, OutputInterface $output): void {
$row = $this->jobList->getDetailsById($jobId);
$lastRun = new \DateTime();

View file

@ -26,7 +26,7 @@
namespace OC\Core\Command\Background;
class WebCron extends Base {
protected function getMode() {
protected function getMode(): string {
return 'webcron';
}
}