@@ -69,19 +69,20 @@ public function handle(Schedule $schedule)
69
69
$ events = $ events ->map (function ($ event ) use ($ terminalWidth , $ expressionSpacing , $ timezone ) {
70
70
$ expression = $ this ->formatCronExpression ($ event ->expression , $ expressionSpacing );
71
71
72
- $ command = $ event ->command ;
73
- $ description = $ event ->description ;
72
+ $ command = $ event ->command ?? '' ;
73
+
74
+ $ description = $ event ->description ?? '' ;
74
75
75
76
if (! $ this ->output ->isVerbose ()) {
76
77
$ command = str_replace ([Application::phpBinary (), Application::artisanBinary ()], [
77
78
'php ' ,
78
79
preg_replace ("#[' \"]# " , '' , Application::artisanBinary ()),
79
- ], $ event -> command );
80
+ ], $ command );
80
81
}
81
82
82
83
if ($ event instanceof CallbackEvent) {
83
- if (class_exists ($ event -> description )) {
84
- $ command = $ event -> description ;
84
+ if (class_exists ($ description )) {
85
+ $ command = $ description ;
85
86
$ description = '' ;
86
87
} else {
87
88
$ command = 'Closure at: ' .$ this ->getClosureLocation ($ event );
@@ -138,7 +139,7 @@ private function getCronExpressionSpacing($events)
138
139
{
139
140
$ rows = $ events ->map (fn ($ event ) => array_map ('mb_strlen ' , preg_split ("/\s+/ " , $ event ->expression )));
140
141
141
- return collect ($ rows [0 ] ?? [])->keys ()->map (fn ($ key ) => $ rows ->max ($ key ));
142
+ return collect ($ rows [0 ] ?? [])->keys ()->map (fn ($ key ) => $ rows ->max ($ key ))-> all () ;
142
143
}
143
144
144
145
/**
@@ -164,7 +165,7 @@ private function sortEvents(\Illuminate\Support\Collection $events, DateTimeZone
164
165
*/
165
166
private function getNextDueDateForEvent ($ event , DateTimeZone $ timezone )
166
167
{
167
- return Carbon::create (
168
+ return Carbon::instance (
168
169
(new CronExpression ($ event ->expression ))
169
170
->getNextRunDate (Carbon::now ()->setTimezone ($ event ->timezone ))
170
171
->setTimezone ($ timezone )
0 commit comments