Permalink
Browse files

remove name from the createEvent params, add api docs

  • Loading branch information...
1 parent 425bb7b commit 0a87311b20eaf3e310ff38356043e08dd30af398 @iampersistent iampersistent committed Aug 3, 2012
@@ -12,7 +12,24 @@
interface EventDispatcherInterface
{
- function createEvent($name, $subject=null);
+ /**
+ * Create a new Event for the dispatcher system
+ *
+ * @param null $subject object that is the subject of the event
+ *
+ * @return instance Vespolina\EventDispatcher\EventInterface
+ */
+ function createEvent($subject=null);
+ /**
+ * Dispatches an event to all registered listeners.
+ *
+ * @param string $eventName The name of the event to dispatch. The name of the event is the name of the method that
+ * is invoked on listeners.
+ * @param Vespolina\EventDispatcher\EventInterface $event The event to pass to the event handlers/listeners.
+ * If not supplied, an empty Event instance is created.
+ *
+ * @return Event
+ */
function dispatch($eventName, EventInterface $event = null);
}
@@ -13,10 +13,9 @@
class NullDispatcher implements EventDispatcherInterface
{
- public function createEvent($name, $subject = null)
+ public function createEvent($subject = null)
{
$event = new Event($subject);
- $event->setName($name);
return $event;
}

0 comments on commit 0a87311

Please sign in to comment.