Skip to content

Commit

Permalink
support new listeners syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Sep 22, 2020
1 parent cd79b30 commit a69fc6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Watchers/EventWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ protected function formatListeners($eventName)

if (is_string($listener)) {
return Str::contains($listener, '@') ? $listener : $listener.'@handle';
} elseif (is_array($listener)) {
} elseif (is_array($listener) && is_string($listener[0])) {
return $listener[0].'@'.$listener[1];
} elseif (is_array($listener) && is_object($listener[0])) {
return get_class($listener[0]).'@'.$listener[1];
}

Expand Down

0 comments on commit a69fc6f

Please sign in to comment.