Skip to content

Commit

Permalink
Fix CronExpression deprecation using constructor instead or factory m…
Browse files Browse the repository at this point in the history
…ethod
  • Loading branch information
bastien-phi committed Jan 17, 2025
1 parent ad0c7c4 commit 5d1bd87
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 5d1bd87

Please sign in to comment.