mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 16:10:00 +00:00
Code cleanup
This commit is contained in:
@@ -33,6 +33,25 @@ use FireflyIII\Support\Cronjobs\TelemetryCronjob;
|
||||
*/
|
||||
trait CronRunner
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function runAutoBudget(): string
|
||||
{
|
||||
/** @var AutoBudgetCronjob $autoBudget */
|
||||
$autoBudget = app(AutoBudgetCronjob::class);
|
||||
try {
|
||||
$result = $autoBudget->fire();
|
||||
} catch (FireflyException $e) {
|
||||
return $e->getMessage();
|
||||
}
|
||||
if (false === $result) {
|
||||
return 'The auto budget cron job did not fire.';
|
||||
}
|
||||
|
||||
return 'The auto budget cron job fired successfully.';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -55,7 +74,8 @@ trait CronRunner
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function runTelemetry(): string {
|
||||
protected function runTelemetry(): string
|
||||
{
|
||||
/** @var TelemetryCronjob $telemetry */
|
||||
$telemetry = app(TelemetryCronjob::class);
|
||||
try {
|
||||
@@ -70,23 +90,4 @@ trait CronRunner
|
||||
return 'The telemetry cron job fired successfully.';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function runAutoBudget(): string
|
||||
{
|
||||
/** @var AutoBudgetCronjob $autoBudget */
|
||||
$autoBudget = app(AutoBudgetCronjob::class);
|
||||
try {
|
||||
$result = $autoBudget->fire();
|
||||
} catch (FireflyException $e) {
|
||||
return $e->getMessage();
|
||||
}
|
||||
if (false === $result) {
|
||||
return 'The auto budget cron job did not fire.';
|
||||
}
|
||||
|
||||
return 'The auto budget cron job fired successfully.';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user