Permalink
Browse files

Register event subscriber in the boot method

The Pimple::extend method was registering the listener each time it id called.
  • Loading branch information...
1 parent bdadc08 commit 8e8029cbf48cfd5c4aa939354bf26e8397c0080e @GromNaN GromNaN committed Oct 4, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 AcceptHeaderServiceProvider.php
@@ -11,19 +11,16 @@ public function register(Application $app)
{
$app['route_class'] = '\\Pff\\ServiceProvider\\AcceptHeaderServiceProvider\\Route';
- $app['dispatcher'] = $app->extend('dispatcher', function($dispatcher) {
- $dispatcher->addSubscriber(new KernelListener());
- return $dispatcher;
- });
-
$app['url_matcher'] = $app->share(function () use ($app) {
$matcher = new UrlMatcher($app['routes'], $app['request_context']);
$matcher->setRequest($app['request']);
+
return $matcher;
});
}
public function boot(Application $app)
{
+ $app['dispatcher']->addSubscriber(new KernelListener());
}
}

0 comments on commit 8e8029c

Please sign in to comment.