Skip to content

Commit

Permalink
Change how the handler is hashed for memory's sake
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker committed Sep 22, 2016
1 parent 04f051e commit f9c1438
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/unit/core/mock/dispatcher.php
Expand Up @@ -126,6 +126,8 @@ public static function mockRegister($event, $handler, $return = null)
self::$handlers[$event] = [];
}

self::$handlers[$event][print_r($handler, true)] = $return;
$identifier = is_array($handler) ? md5(serialize($handler)) : spl_object_hash($handler);

self::$handlers[$event][$identifier] = $return;
}
}

0 comments on commit f9c1438

Please sign in to comment.