Skip to content

Commit

Permalink
Updates in support of framework changes to support Laravel 8
Browse files Browse the repository at this point in the history
Laravel changed the return of `getSummaryForDisplay` to be `Callback`,
rather than `Closure`, in order to support PHP 8.

@see laravel/framework#34999
  • Loading branch information
michaeldyrynda committed Nov 17, 2020
1 parent 667088b commit 6b7fb88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/TaskIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class TaskIdentifier
public function __invoke($task)
{
if ($task instanceof CallbackEvent) {
if (is_null($task->command) && $task->description && class_exists($task->description)) {
if (trim($task->command) === '' && $task->description && class_exists($task->description)) {
return static::TYPE_JOB;
}

if (is_null($task->command) && Str::is($task->description, $task->getSummaryForDisplay())) {
if (trim($task->command) === '' && Str::is($task->description, $task->getSummaryForDisplay())) {
return static::TYPE_CLOSURE;
}

if (Str::is($task->getSummaryForDisplay(), 'Closure')) {
if (Str::is(['Closure', 'Callback'], $task->getSummaryForDisplay())) {
return static::TYPE_CLOSURE;
}
}
Expand Down

0 comments on commit 6b7fb88

Please sign in to comment.