mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Make dispatch return CakeEvent - resolves #2819
This commit is contained in:
parent
9892cd0240
commit
5d4bb9c2e0
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue