ConfigBasedRouter (with example) and Upgradeable Entities #4

Merged
merged 6 commits into from Apr 20, 2012

Conversation

Projects
None yet
2 participants
Contributor

robotsnowfall commented Dec 2, 2011

No description provided.

@spiralout spiralout commented on the diff Dec 6, 2011

library/Tracks/EventHandler/ConfigBasedRouter.php
+ *
+ * The 2nd argument may be either an instantiated object, or the name of a
+ * class to instantiate. In the second case, the class should not have any
+ * required parameters on it's constructor.
+ *
+ * @param string $eventClass The Event classname
+ * @param IEventHandler $handler An EventHandler
+ *
+ * @return null
+ */
+ public function addHandler($eventClass, $handler)
+ {
+ assert('is_string($eventClass)');
+ assert('class_exists($eventClass)');
+
+ if (!($handler instanceof IEventHandler)) {
@spiralout

spiralout Dec 6, 2011

Owner

According to the doc block, I can pass in either an object or the name of a class to instantiate for $handler. If I pass in the name of a class, this will throw an exception.

@spiralout spiralout added a commit that referenced this pull request Apr 20, 2012

@spiralout spiralout Merge pull request #4 from dalanhurst/master
ConfigBasedRouter (with example) and Upgradeable Entities
9f705be

@spiralout spiralout merged commit 9f705be into spiralout:master Apr 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment