Code reordering and reformatting. I should really start employing style CI.

This commit is contained in:
James Cole
2021-09-18 10:26:12 +02:00
parent 9b9d52e99f
commit 4003cea759
344 changed files with 2776 additions and 2605 deletions

View File

@@ -32,16 +32,14 @@ use Carbon\Carbon;
*/
abstract class AbstractCronjob
{
public bool $jobErrored;
public bool $jobFired;
public bool $jobSucceeded;
public ?string $message;
public int $timeBetweenRuns = 43200;
protected Carbon $date;
protected bool $force;
public bool $jobFired;
public bool $jobSucceeded;
public bool $jobErrored;
public ?string $message;
/**
* AbstractCronjob constructor.
*/
@@ -65,7 +63,7 @@ abstract class AbstractCronjob
*/
final public function setDate(Carbon $date): void
{
$newDate = clone $date;
$newDate = clone $date;
$this->date = $newDate;
}

View File

@@ -23,6 +23,7 @@
declare(strict_types=1);
namespace FireflyIII\Support\Cronjobs;
use Carbon\Carbon;
use FireflyIII\Jobs\CreateAutoBudgetLimits;
use FireflyIII\Models\Configuration;
@@ -43,7 +44,7 @@ class AutoBudgetCronjob extends AbstractCronjob
$config = app('fireflyconfig')->get('last_ab_job', 0);
$lastTime = (int)$config->data;
$diff = time() - $lastTime;
$diffForHumans = Carbon::now()->diffForHumans(Carbon::createFromTimestamp($lastTime),null, true);
$diffForHumans = Carbon::now()->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
if (0 === $lastTime) {
Log::info('Auto budget cron-job has never fired before.');
}
@@ -53,6 +54,7 @@ class AutoBudgetCronjob extends AbstractCronjob
if (false === $this->force) {
Log::info('The auto budget cron-job will not fire now.');
$this->message = sprintf('It has been %s since the auto budget cron-job has fired. It will not fire now.', $diffForHumans);
return;
}

View File

@@ -44,7 +44,7 @@ class RecurringCronjob extends AbstractCronjob
$config = app('fireflyconfig')->get('last_rt_job', 0);
$lastTime = (int)$config->data;
$diff = time() - $lastTime;
$diffForHumans = Carbon::now()->diffForHumans(Carbon::createFromTimestamp($lastTime), null,true);
$diffForHumans = Carbon::now()->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
if (0 === $lastTime) {
Log::info('Recurring transactions cron-job has never fired before.');