Skip to content

Commit 4c3ca64

Browse files
committed
[TASK] use constants for commands return
1 parent 70247b6 commit 4c3ca64

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

Classes/Command/CollectGarbageCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public function execute(InputInterface $input, OutputInterface $output): int
3535
$job->fail('job too old');
3636
$this->jobRepository->updateJob($job);
3737
}
38-
return 0;
38+
return Command::SUCCESS;
3939
}
4040
}

Classes/Command/JobCreatorCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ public function execute(InputInterface $input, OutputInterface $output): int
4747
$output->writeln($e->getMessage());
4848
return Command::FAILURE;
4949
}
50-
return 0;
50+
return Command::SUCCESS;
5151
}
5252
}

Classes/Command/JobKillerCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public function execute(InputInterface $input, OutputInterface $output): int
3232
{
3333
$job = $this->jobRepository->findOneLast();
3434
if ($job === null) {
35-
return 0;
35+
return Command::SUCCESS;
3636
}
3737
$job->kill();
3838
$this->jobRepository->updateJob($job);
39-
return 0;
39+
return Command::SUCCESS;
4040
}
4141
}

Classes/Command/RunnerCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public function execute(InputInterface $input, OutputInterface $output): int
3737
{
3838
$runningJob = $this->jobRepository->findOneRunning();
3939
if ($runningJob !== null) {
40-
return 0;
40+
return Command::SUCCESS;
4141
}
4242
$job = $this->jobRepository->findOneWaiting();
4343
if ($job === null) {
44-
return 0;
44+
return Command::SUCCESS;
4545
}
4646
$job->start();
4747
$this->jobRepository->updateJob($job);
@@ -57,11 +57,11 @@ public function execute(InputInterface $input, OutputInterface $output): int
5757
// @extensionScannerIgnoreLine
5858
$job->finish();
5959
$this->jobRepository->updateJob($job);
60-
return 0;
60+
return Command::SUCCESS;
6161
} catch (Exception $e) {
6262
$job->fail($e->getCode() . ' - ' . $e->getMessage());
6363
$this->jobRepository->updateJob($job);
64-
return 1;
64+
return Command::FAILURE;
6565
}
6666
}
6767
}

Classes/Command/StatusReportCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ public function execute(InputInterface $input, OutputInterface $output): int
8989
} else {
9090
$output->writeln(LocalizationUtility::translate($llPrefix . 'no-jobs'));
9191
}
92-
return 0;
92+
return Command::SUCCESS;
9393
}
9494
}

0 commit comments

Comments
 (0)