diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-02-05 12:04:55 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-02-05 12:14:47 +0100 |
commit | f6ddda8dadeed923a213f66d96d4e9f0a7d6b9fa (patch) | |
tree | 6dc098899704db2660fc61f36af3bd36effbadec /lib | |
parent | 4b97ef9b41c876517b788dbae601b23f11d26096 (diff) | |
download | nextcloud-server-f6ddda8dadeed923a213f66d96d4e9f0a7d6b9fa.tar.gz nextcloud-server-f6ddda8dadeed923a213f66d96d4e9f0a7d6b9fa.zip |
Test the symfony adapter
To prevent regression in the future.
And make sure we always return an object …
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/EventDispatcher/EventDispatcher.php | 3 | ||||
-rw-r--r-- | lib/private/EventDispatcher/SymfonyAdapter.php | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/EventDispatcher/EventDispatcher.php b/lib/private/EventDispatcher/EventDispatcher.php index 8fe4bcbb942..4e1fba67663 100644 --- a/lib/private/EventDispatcher/EventDispatcher.php +++ b/lib/private/EventDispatcher/EventDispatcher.php @@ -81,6 +81,9 @@ class EventDispatcher implements IEventDispatcher { $this->addListener($eventName, $listener, $priority); } + /** + * @deprecated + */ public function dispatch(string $eventName, Event $event): void { $this->dispatcher->dispatch($event, $eventName); diff --git a/lib/private/EventDispatcher/SymfonyAdapter.php b/lib/private/EventDispatcher/SymfonyAdapter.php index b1e5aa86049..3bd74e719fb 100644 --- a/lib/private/EventDispatcher/SymfonyAdapter.php +++ b/lib/private/EventDispatcher/SymfonyAdapter.php @@ -87,7 +87,8 @@ class SymfonyAdapter implements EventDispatcherInterface { // Event with no payload (object) need special handling if ($newEvent === null) { - return $this->eventDispatcher->getSymfonyDispatcher()->dispatch($eventName); + $this->eventDispatcher->getSymfonyDispatcher()->dispatch($eventName); + return new Event(); } // Flip the argument order for Symfony to prevent a trigger_error |