diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-09-11 21:02:50 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-09-11 21:02:50 +0300 |
commit | b9e14d5972d403a669a23e11b4b1359995d65ccc (patch) | |
tree | 8189f8b6e5289db2e52df9905be3aa71a26ff454 /lib/public/EventDispatcher | |
parent | 15d39c48e652a76fd63b6986ecbabe62c00631cb (diff) |
Add Symfony inspired typed event dispatcher method
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/public/EventDispatcher')
-rw-r--r-- | lib/public/EventDispatcher/IEventDispatcher.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/public/EventDispatcher/IEventDispatcher.php b/lib/public/EventDispatcher/IEventDispatcher.php index af4d5316a7b..630b7e3c8a0 100644 --- a/lib/public/EventDispatcher/IEventDispatcher.php +++ b/lib/public/EventDispatcher/IEventDispatcher.php @@ -58,4 +58,16 @@ interface IEventDispatcher { */ public function dispatch(string $eventName, Event $event): void; + /** + * Dispatch a typed event + * + * Only use this with subclasses of ``\OCP\EventDispatcher\Event``. + * The object's class will determine the event name. + * + * @param Event $event + * + * @since 18.0.0 + */ + public function dispatchTyped(Event $event): void; + } |