mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Cast results of implementedEvents to an array.
This makes using mocks much easier with event listeners as they don't need to provide a returnValue for implementedEvents. Refs #2333
This commit is contained in:
parent
a57c46ff93
commit
e6f2c92005
1 changed files with 1 additions and 1 deletions
|
@ -122,7 +122,7 @@ class CakeEventManager {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _attachSubscriber(CakeEventListener $subscriber) {
|
protected function _attachSubscriber(CakeEventListener $subscriber) {
|
||||||
foreach ($subscriber->implementedEvents() as $eventKey => $function) {
|
foreach ((array)$subscriber->implementedEvents() as $eventKey => $function) {
|
||||||
$options = array();
|
$options = array();
|
||||||
$method = $function;
|
$method = $function;
|
||||||
if (is_array($function) && isset($function['callable'])) {
|
if (is_array($function) && isset($function['callable'])) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue