Throw exception if `AbstractEventListener` does not handle event
authorMatthias Schmidt <gravatronics@live.com>
Wed, 21 Apr 2021 14:42:42 +0000 (16:42 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 21 Apr 2021 14:42:42 +0000 (16:42 +0200)
wcfsetup/install/files/lib/system/event/listener/AbstractEventListener.class.php

index 42bc81a7f446eb79dfdbed03c8191c12508431b4..e3aa1ccfd640e5be6ac641d0a53ffb4fa8c2f50e 100644 (file)
@@ -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.");
         }
     }
 }