improved callback code
This commit is contained in:
parent
c58298a0bd
commit
df7c025aaa
@ -120,13 +120,12 @@ class CallbackManager {
|
|||||||
$removed = false;
|
$removed = false;
|
||||||
foreach ($this->callbackListeners as &$listeners) {
|
foreach ($this->callbackListeners as &$listeners) {
|
||||||
foreach ($listeners as $key => &$listenerCallback) {
|
foreach ($listeners as $key => &$listenerCallback) {
|
||||||
if ($listenerCallback[0] != $listener) {
|
if ($listenerCallback[0] === $listener) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
unset($listeners[$key]);
|
unset($listeners[$key]);
|
||||||
$removed = true;
|
$removed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $removed;
|
return $removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,13 +139,12 @@ class CallbackManager {
|
|||||||
$removed = false;
|
$removed = false;
|
||||||
foreach ($this->scriptCallbackListener as &$listeners) {
|
foreach ($this->scriptCallbackListener as &$listeners) {
|
||||||
foreach ($listeners as $key => &$listenerCallback) {
|
foreach ($listeners as $key => &$listenerCallback) {
|
||||||
if ($listenerCallback[0] != $listener) {
|
if ($listenerCallback[0] === $listener) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
unset($listeners[$key]);
|
unset($listeners[$key]);
|
||||||
$removed = true;
|
$removed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $removed;
|
return $removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user