mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Adjusted conditions nesting in yii\base\Event
This commit is contained in:

committed by
Alexander Makarov

parent
b32db9fb28
commit
29b5f33722
@ -211,13 +211,15 @@ class Event extends Object
|
||||
);
|
||||
|
||||
foreach ($classes as $class) {
|
||||
if (!empty(self::$_events[$name][$class])) {
|
||||
foreach (self::$_events[$name][$class] as $handler) {
|
||||
$event->data = $handler[1];
|
||||
call_user_func($handler[0], $event);
|
||||
if ($event->handled) {
|
||||
return;
|
||||
}
|
||||
if (empty(self::$_events[$name][$class])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (self::$_events[$name][$class] as $handler) {
|
||||
$event->data = $handler[1];
|
||||
call_user_func($handler[0], $event);
|
||||
if ($event->handled) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user