public static function build(array $configuration) { $routeCollection = new RouteCollection(); $urlMatcher = new UrlMatcher(); $logger = LoggerProvider::build($configuration); return new FrontendController($routeCollection, $urlMatcher, $logger); }
private static function buildForDebug($configuration, $dispatcher, $frontendController) { $controllerResolver = new ControllerResolver(); $dispatcher->addSubscriber(new Firewall($configuration['security.firewalls'], $controllerResolver)); $logger = LoggerProvider::build($configuration); $dispatcher->addSubscriber(new LogListener($logger)); $dispatcher->addSubscriber(new ResponseListener($configuration['charset'])); $dispatcher->addSubscriber(new StringToResponseListener()); $resolver = new RequestControllerResolver($dispatcher, $controllerResolver); $requestStack = new RequestStack(); return new HttpKernel($dispatcher, $resolver, $requestStack, $frontendController); }