Commit a51a9a14 authored by Jérôme Tamarelle's avatar Jérôme Tamarelle

Make the event dispatcher class configurable.

parent 81bafcc6
......@@ -32,7 +32,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RequestContext;
......@@ -86,8 +85,9 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
return new ExceptionHandler();
});
$this['dispatcher_class'] = 'Symfony\\Component\\EventDispatcher\\EventDispatcher';
$this['dispatcher'] = $this->share(function () use ($app) {
$dispatcher = new EventDispatcher();
$dispatcher = new $this['dispatcher_class']();
$dispatcher->addSubscriber($app);
$urlMatcher = new LazyUrlMatcher(function () use ($app) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment