Use PSR-12 code style

This commit is contained in:
James Cole
2022-10-30 12:24:51 +01:00
parent bdcd9825ec
commit b27fe59ab4
44 changed files with 414 additions and 332 deletions

View File

@@ -68,7 +68,7 @@ class Cron extends Command
} catch (InvalidArgumentException $e) {
$this->error(sprintf('"%s" is not a valid date', $this->option('date')));
}
$force = (bool) $this->option('force');
$force = (bool)$this->option('force');
/*
* Fire recurring transaction cron job.
@@ -122,8 +122,35 @@ class Cron extends Command
}
/**
* @param bool $force
* @param Carbon|null $date
* @param bool $force
* @param Carbon|null $date
* @throws FireflyException
*/
private function exchangeRatesCronJob(bool $force, ?Carbon $date): void
{
$exchangeRates = new ExchangeRatesCronjob();
$exchangeRates->setForce($force);
// set date in cron job:
if (null !== $date) {
$exchangeRates->setDate($date);
}
$exchangeRates->fire();
if ($exchangeRates->jobErrored) {
$this->error(sprintf('Error in "exchange rates" cron: %s', $exchangeRates->message));
}
if ($exchangeRates->jobFired) {
$this->line(sprintf('"Exchange rates" cron fired: %s', $exchangeRates->message));
}
if ($exchangeRates->jobSucceeded) {
$this->info(sprintf('"Exchange rates" cron ran with success: %s', $exchangeRates->message));
}
}
/**
* @param bool $force
* @param Carbon|null $date
*
* @throws FireflyException
*/
@@ -150,8 +177,8 @@ class Cron extends Command
}
/**
* @param bool $force
* @param Carbon|null $date
* @param bool $force
* @param Carbon|null $date
*
*/
private function autoBudgetCronJob(bool $force, ?Carbon $date): void
@@ -177,8 +204,8 @@ class Cron extends Command
}
/**
* @param bool $force
* @param Carbon|null $date
* @param bool $force
* @param Carbon|null $date
* @throws FireflyException
*/
private function billWarningCronJob(bool $force, ?Carbon $date): void
@@ -202,31 +229,4 @@ class Cron extends Command
$this->info(sprintf('"Send bill warnings" cron ran with success: %s', $autoBudget->message));
}
}
/**
* @param bool $force
* @param Carbon|null $date
* @throws FireflyException
*/
private function exchangeRatesCronJob(bool $force, ?Carbon $date): void
{
$exchangeRates = new ExchangeRatesCronjob();
$exchangeRates->setForce($force);
// set date in cron job:
if (null !== $date) {
$exchangeRates->setDate($date);
}
$exchangeRates->fire();
if ($exchangeRates->jobErrored) {
$this->error(sprintf('Error in "exchange rates" cron: %s', $exchangeRates->message));
}
if ($exchangeRates->jobFired) {
$this->line(sprintf('"Exchange rates" cron fired: %s', $exchangeRates->message));
}
if ($exchangeRates->jobSucceeded) {
$this->info(sprintf('"Exchange rates" cron ran with success: %s', $exchangeRates->message));
}
}
}