[CORE][Event] Fix bug on handler Log

This commit is contained in:
Diogo Peralta Cordeiro 2021-08-11 23:47:12 +01:00 committed by Hugo Sales
parent 4ecdeac6a3
commit de8a2f579c
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -83,7 +83,7 @@ abstract class Event
{
self::$dispatcher->addListener(
$ns . $name,
function ($event, $event_name, $dispatcher) use ($handler) {
function ($event, $event_name, $dispatcher) use ($handler, $name) {
// Old style of events (preferred)
if ($event instanceof GenericEvent) {
if (call_user_func_array($handler, $event->getArguments()) === self::stop) {
@ -93,7 +93,7 @@ abstract class Event
}
// @codeCoverageIgnoreStart
// Symfony style of events
Log::warning("Event::addHandler for {$name} doesn't Conform to GNU social guidelines. Use of this style of event is discouraged");
Log::warning("Event::addHandler for {$name} doesn't Conform to GNU social guidelines. Use of this style of event is discouraged.");
call_user_func($handler, $event, $event_name, $dispatcher);
return null;
// @codeCoverageIgnoreEnd