. */ declare(strict_types=1); namespace FireflyIII\Support\Cronjobs; use Carbon\Carbon; use Exception; use FireflyIII\Exceptions\FireflyException; /** * Class AbstractCronjob * * @codeCoverageIgnore */ abstract class AbstractCronjob { public int $timeBetweenRuns = 43200; protected Carbon $date; protected bool $force; public bool $jobFired; public bool $jobSucceeded; public bool $jobErrored; public ?string $message; /** * AbstractCronjob constructor. */ public function __construct() { $this->force = false; $this->date = today(config('app.timezone')); $this->jobErrored = false; $this->jobSucceeded = false; $this->jobFired = false; $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; } }