Code cleanup

This commit is contained in:
James Cole
2021-03-21 09:15:40 +01:00
parent da1751940e
commit 206845575c
317 changed files with 7418 additions and 7362 deletions

View File

@@ -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.';
}
}