Skip to content

Commit ddab370

Browse files
authored
Initializes CronExpression class using new (#36600)
1 parent e4ed331 commit ddab370

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Illuminate/Console/Scheduling/Event.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ protected function expressionPasses()
328328
$date->setTimezone($this->timezone);
329329
}
330330

331-
return CronExpression::factory($this->expression)->isDue($date->toDateTimeString());
331+
return (new CronExpression($this->expression))->isDue($date->toDateTimeString());
332332
}
333333

334334
/**
@@ -890,9 +890,8 @@ public function getSummaryForDisplay()
890890
*/
891891
public function nextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false)
892892
{
893-
return Date::instance(CronExpression::factory(
894-
$this->getExpression()
895-
)->getNextRunDate($currentTime, $nth, $allowCurrentDate, $this->timezone));
893+
return Date::instance((new CronExpression($this->getExpression()))
894+
->getNextRunDate($currentTime, $nth, $allowCurrentDate, $this->timezone));
896895
}
897896

898897
/**

0 commit comments

Comments
 (0)