-
-
Notifications
You must be signed in to change notification settings - Fork 202
Description
Laravel 5.4 will probably be released this or next month and there is a compatibility issue which will have to be addressed.
There has been some changes to Illuminate\Events\Dispatcher, eg. in this commit. It no longer exposes the firing() method used in SentryLaravelEventHandler. From what I understand it is used to retrieve the name of the current event and direct the control flow accordingly.
In 5.4, when an wildcard event listener has been registered, the listener method will be called with two arguments:
- Event name
- Event payload
That said, following changes will be required in SentryLaravelEventHandler::onWildcardEvent.
- Add previously mentioned arguments:
public function onWildcardEvent($eventName, $payload)- Instead of
$args = func_get_args();we can use the second argument which is the event payload. Eg.
$route = $args[0]->route;will have to be replaced with
$route = $payload[0]->route;While we're on the subject of the onWildcardEvent method it feels a bit messy for me. I refactored it here, tell me what do you think.
Also, event names have changed. Eg. Laravel no longer raises illuminate.log event, instead an instance of Illuminate\Log\Events\MessageLogged is sent. You can see more in this commit. I reflected these changes in the Gist.
For now it's all I have discovered in this subject. Tell me if you're interested in a Pull Request regarding these changes.