public function __construct(Profiler $profiler = null, \Twig_Environment $twig, UrlMatcherInterface $matcher = null, RouteCollection $routes = null) { $this->profiler = $profiler; $this->twig = $twig; $this->matcher = $matcher; $this->routes = null === $routes && $matcher instanceof RouterInterface ? $matcher->getRouteCollection() : $routes; }