From 5d4bb9c2e0b67717fca80db0dd09ea40c6029713 Mon Sep 17 00:00:00 2001 From: euromark Date: Sun, 6 Apr 2014 21:17:51 +0200 Subject: [PATCH] Make dispatch return CakeEvent - resolves #2819 --- lib/Cake/Event/CakeEventManager.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Event/CakeEventManager.php b/lib/Cake/Event/CakeEventManager.php index 0a5a94e7c..c75bc924c 100644 --- a/lib/Cake/Event/CakeEventManager.php +++ b/lib/Cake/Event/CakeEventManager.php @@ -222,7 +222,7 @@ class CakeEventManager { * Dispatches a new event to all configured listeners * * @param string|CakeEvent $event the event key name or instance of CakeEvent - * @return void + * @return CakeEvent */ public function dispatch($event) { if (is_string($event)) { @@ -231,7 +231,7 @@ class CakeEventManager { $listeners = $this->listeners($event->name()); if (empty($listeners)) { - return; + return $event; } foreach ($listeners as $listener) { @@ -250,6 +250,7 @@ class CakeEventManager { $event->result = $result; } } + return $event; } /**