Browse Source

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
mark_story 12 years ago
parent
commit
e6f2c92005
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Cake/Event/CakeEventManager.php

+ 1 - 1
lib/Cake/Event/CakeEventManager.php

@@ -122,7 +122,7 @@ class CakeEventManager {
  * @return void
  */
 	protected function _attachSubscriber(CakeEventListener $subscriber) {
-		foreach ($subscriber->implementedEvents() as $eventKey => $function) {
+		foreach ((array)$subscriber->implementedEvents() as $eventKey => $function) {
 			$options = array();
 			$method = $function;
 			if (is_array($function) && isset($function['callable'])) {