/** * @param Event $event */ protected function dispatchEvent(Event $event) { $type = $event->getType(); if ($this->hasListenersForType($type)) { foreach ($this->eventListeners[$type] as $listener) { call_user_func($listener, $event); if ($event->cancelled()) { break; } } } }
/** * @param Event $e */ public function onFormValid(Event $e) { echo $e->getType() . '<br/>'; }