File tree 2 files changed +17
-18
lines changed
src/Illuminate/Console/Scheduling
2 files changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -624,6 +624,21 @@ public function getSummaryForDisplay()
624
624
return $ this ->buildCommand ();
625
625
}
626
626
627
+ /**
628
+ * Determine the next due date for an event.
629
+ *
630
+ * @param \DateTime|string $currentTime
631
+ * @param int $nth
632
+ * @param bool $allowCurrentDate
633
+ * @return \Carbon\Carbon
634
+ */
635
+ public function nextRunDate ($ currentTime = 'now ' , $ nth = 0 , $ allowCurrentDate = false )
636
+ {
637
+ return Carbon::instance ($ nextDue = CronExpression::factory (
638
+ $ this ->getExpression ()
639
+ )->getNextRunDate ($ currentTime , $ nth , $ allowCurrentDate ));
640
+ }
641
+
627
642
/**
628
643
* Get the Cron expression for the event.
629
644
*
@@ -646,20 +661,4 @@ public function preventOverlapsUsing(Mutex $mutex)
646
661
647
662
return $ this ;
648
663
}
649
-
650
- /**
651
- * Determine next due date for Event.
652
- * @param DateTime|string $currentTime Relative calculation date
653
- * @param int $nth Number of matches to skip before returning a matching next run date
654
- * @param bool $allowCurrentDate Return the current date if it matches the cron expression.
655
- * @return Carbon
656
- */
657
- public function nextDue ($ currentTime = 'now ' , $ nth = 0 , $ allowCurrentDate = false )
658
- {
659
- $ nextDue = CronExpression::factory (
660
- $ this ->getExpression ()
661
- )->getNextRunDate ($ currentTime , $ nth , $ allowCurrentDate );
662
-
663
- return Carbon::instance ($ nextDue );
664
- }
665
664
}
Original file line number Diff line number Diff line change @@ -56,11 +56,11 @@ public function testBuildCommandAppendOutput()
56
56
$ this ->assertSame ("php -i >> {$ quote }/dev/null {$ quote } 2>&1 " , $ event ->buildCommand ());
57
57
}
58
58
59
- public function testNextDue ()
59
+ public function testNextRunDate ()
60
60
{
61
61
$ event = new Event (m::mock ('Illuminate\Console\Scheduling\Mutex ' ), 'php -i ' );
62
62
$ event ->dailyAt ('10:15 ' );
63
63
64
- $ this ->assertSame ('10:15:00 ' , $ event ->nextDue ()->toTimeString ());
64
+ $ this ->assertSame ('10:15:00 ' , $ event ->nextRunDate ()->toTimeString ());
65
65
}
66
66
}
You can’t perform that action at this time.
0 commit comments