mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Code cleanup.
This commit is contained in:
@@ -27,8 +27,6 @@ use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class AbstractCronjob
|
||||
*
|
||||
|
||||
*/
|
||||
abstract class AbstractCronjob
|
||||
{
|
||||
@@ -53,23 +51,14 @@ abstract class AbstractCronjob
|
||||
$this->message = null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
abstract public function fire(): void;
|
||||
|
||||
/**
|
||||
* @param Carbon $date
|
||||
*/
|
||||
final public function setDate(Carbon $date): void
|
||||
{
|
||||
$newDate = clone $date;
|
||||
$this->date = $newDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $force
|
||||
*/
|
||||
final public function setForce(bool $force): void
|
||||
{
|
||||
$this->force = $force;
|
||||
|
||||
@@ -33,9 +33,6 @@ use FireflyIII\Models\Configuration;
|
||||
*/
|
||||
class AutoBudgetCronjob extends AbstractCronjob
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function fire(): void
|
||||
{
|
||||
/** @var Configuration $config */
|
||||
@@ -66,12 +63,10 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
app('preferences')->mark();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function fireAutoBudget(): void
|
||||
{
|
||||
app('log')->info(sprintf('Will now fire auto budget cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
|
||||
/** @var CreateAutoBudgetLimits $job */
|
||||
$job = app(CreateAutoBudgetLimits::class, [$this->date]);
|
||||
$job->setDate($this->date);
|
||||
|
||||
@@ -43,6 +43,7 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
public function fire(): void
|
||||
{
|
||||
app('log')->debug(sprintf('Now in %s', __METHOD__));
|
||||
|
||||
/** @var Configuration $config */
|
||||
$config = app('fireflyconfig')->get('last_bw_job', 0);
|
||||
$lastTime = (int)$config->data;
|
||||
@@ -77,12 +78,10 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
app('preferences')->mark();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function fireWarnings(): void
|
||||
{
|
||||
app('log')->info(sprintf('Will now fire bill warning job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
|
||||
/** @var WarnAboutBills $job */
|
||||
$job = app(WarnAboutBills::class);
|
||||
$job->setDate($this->date);
|
||||
|
||||
@@ -33,9 +33,6 @@ use FireflyIII\Models\Configuration;
|
||||
*/
|
||||
class ExchangeRatesCronjob extends AbstractCronjob
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function fire(): void
|
||||
{
|
||||
/** @var Configuration $config */
|
||||
@@ -67,12 +64,10 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
app('preferences')->mark();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function fireExchangeRateJob(): void
|
||||
{
|
||||
app('log')->info(sprintf('Will now fire exchange rates cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
|
||||
/** @var DownloadExchangeRates $job */
|
||||
$job = app(DownloadExchangeRates::class);
|
||||
$job->setDate($this->date);
|
||||
|
||||
@@ -43,6 +43,7 @@ class RecurringCronjob extends AbstractCronjob
|
||||
public function fire(): void
|
||||
{
|
||||
app('log')->debug(sprintf('Now in %s', __METHOD__));
|
||||
|
||||
/** @var Configuration $config */
|
||||
$config = app('fireflyconfig')->get('last_rt_job', 0);
|
||||
$lastTime = (int)$config->data;
|
||||
@@ -76,12 +77,10 @@ class RecurringCronjob extends AbstractCronjob
|
||||
app('preferences')->mark();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function fireRecurring(): void
|
||||
{
|
||||
app('log')->info(sprintf('Will now fire recurring cron job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
|
||||
/** @var CreateRecurringTransactions $job */
|
||||
$job = app(CreateRecurringTransactions::class);
|
||||
$job->setDate($this->date);
|
||||
|
||||
Reference in New Issue
Block a user