Skip to content

Commit

Permalink
Merge pull request #118 from bastien-phi/fix-cron-expression-deprecation
Browse files Browse the repository at this point in the history
Fix CronExpression deprecation using constructor instead of factory method
  • Loading branch information
freekmurze authored Jan 17, 2025
2 parents ad0c7c4 + 5d1bd87 commit 8e884c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Support/ScheduledTasks/Tasks/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ public function isBeingMonitoredAtOhDear(): bool

public function previousRunAt(): CarbonInterface
{
$dateTime = CronExpression::factory($this->cronExpression())->getPreviousRunDate(now());
$dateTime = (new CronExpression($this->cronExpression()))->getPreviousRunDate(now());

return Date::instance($dateTime);
}

public function nextRunAt(CarbonInterface $now = null): CarbonInterface
{
$dateTime = CronExpression::factory($this->cronExpression())->getNextRunDate(
$dateTime = (new CronExpression($this->cronExpression()))->getNextRunDate(
$now ?? now(),
0,
false,
Expand Down

0 comments on commit 8e884c8

Please sign in to comment.