mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #2427 from EliuFlorez/patch-3
Cast implemented events to an array when detaching listeners. This makes it much simpler to work with mocks, and avoids warnings caused by developer error.
This commit is contained in:
commit
58317d312c
1 changed files with 1 additions and 1 deletions
|
@ -197,7 +197,7 @@ class CakeEventManager {
|
|||
* @return void
|
||||
*/
|
||||
protected function _detachSubscriber(CakeEventListener $subscriber, $eventKey = null) {
|
||||
$events = $subscriber->implementedEvents();
|
||||
$events = (array)$subscriber->implementedEvents();
|
||||
if (!empty($eventKey) && empty($events[$eventKey])) {
|
||||
return;
|
||||
} elseif (!empty($eventKey)) {
|
||||
|
|
Loading…
Reference in a new issue