From 9b8d1fce7ce667e2c798c9fa97cd992b85ce7ea1 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 21 Apr 2021 16:42:42 +0200 Subject: [PATCH] Throw exception if `AbstractEventListener` does not handle event --- .../lib/system/event/listener/AbstractEventListener.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wcfsetup/install/files/lib/system/event/listener/AbstractEventListener.class.php b/wcfsetup/install/files/lib/system/event/listener/AbstractEventListener.class.php index 42bc81a7f4..e3aa1ccfd6 100644 --- a/wcfsetup/install/files/lib/system/event/listener/AbstractEventListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/AbstractEventListener.class.php @@ -48,6 +48,8 @@ abstract class AbstractEventListener implements IParameterizedEventListener if (\method_exists($this, $methodName)) { $this->{$methodName}($eventObj, $parameters); + } else { + throw new \LogicException("Event listener does not handle '{$eventName}' event."); } } } -- 2.20.1