Skip to content

Commit

Permalink
Use Str class to determine if the command is empty, to account for nu…
Browse files Browse the repository at this point in the history
…ll or empty string
  • Loading branch information
michaeldyrynda committed Nov 17, 2020
1 parent 5056c33 commit 3302466
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,11 +19,11 @@ class TaskIdentifier
public function __invoke($task)
{
if ($task instanceof CallbackEvent) {
if (is_null($task->command) && $task->description && class_exists($task->description)) {
if (Str::of($task->command)->isEmpty() && $task->description && class_exists($task->description)) {
return static::TYPE_JOB;
}

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

Expand All @@ -47,6 +47,6 @@ private function sanitisedCommand(?string $command): string
"'",
'"',
PHP_BINARY,
], '', $command)) ?: '';
], '', $command));
}
}

0 comments on commit 3302466

Please sign in to comment.