From aac653d2bd991650e27652899179ceeaacd0dc72 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 3 Aug 2020 20:55:07 +0000 Subject: [PATCH] [EVENT] Fix event handler and rename events to snake_case --- src/Core/Event.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Core/Event.php b/src/Core/Event.php index 1c6fba2d2f..a6e289275b 100644 --- a/src/Core/Event.php +++ b/src/Core/Event.php @@ -78,7 +78,7 @@ abstract class Event public static function addHandler(string $name, callable $handler, int $priority = 0, - string $ns = 'GNUsocial/'): void + string $ns = 'GNUsocial.'): void { self::$dispatcher->addListener( $ns . $name, @@ -116,9 +116,9 @@ abstract class Event * @return bool flag saying whether to continue processing, based * on results of handlers. */ - public static function handle(string $name, array $args = [], string $ns = 'GNUsocial/'): bool + public static function handle(string $name, array $args = [], string $ns = 'GNUsocial.'): bool { - return !(self::$dispatcher->dispatch(new GenericEvent($ns . $name, $args), $name)->isPropagationStopped()); + return !(self::$dispatcher->dispatch(new GenericEvent($name, $args), $ns . $name)->isPropagationStopped()); } /**