function dispatch($eventName, Event $event = null) { if ($event == null) { $event = new Event(null); } $event->setEventName($eventName); $event->setDispatcher($this); $sortedListeners = $this->sortListeners($eventName); foreach ($sortedListeners as $listeners) { foreach ($listeners as $listener) { call_user_func($listener, $event); if ($event->isEventPropagationStopped()) { break; } } } return $event; }
public function __construct(Request $request, Response $response) { parent::__construct($request); $this->response = $response; }
public function __construct(Request $request) { parent::__construct($request); }