diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 7160a372af..40b0281831 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +4.1.0 +----- + + * allowed to pass an optional `LoggerInterface $logger` instance to the `Router` + 4.0.0 ----- diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml index f6bd479d8e..81af5c397c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml @@ -51,6 +51,7 @@ + %router.resource% @@ -66,6 +67,7 @@ %router.cache_class_prefix%UrlMatcher + diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php b/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php index 0148dbf73d..232b39283c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php +++ b/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Routing; +use Psr\Log\LoggerInterface; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\Config\ContainerParametersResource; use Symfony\Component\DependencyInjection\ServiceSubscriberInterface; @@ -33,17 +34,19 @@ class Router extends BaseRouter implements WarmableInterface, ServiceSubscriberI private $collectedParameters = array(); /** - * @param ContainerInterface $container A ContainerInterface instance - * @param mixed $resource The main resource to load - * @param array $options An array of options - * @param RequestContext $context The context + * @param ContainerInterface $container A ContainerInterface instance + * @param mixed $resource The main resource to load + * @param array $options An array of options + * @param RequestContext $context The context + * @param LoggerInterface|null $logger */ - public function __construct(ContainerInterface $container, $resource, array $options = array(), RequestContext $context = null) + public function __construct(ContainerInterface $container, $resource, array $options = array(), RequestContext $context = null, LoggerInterface $logger = null) { $this->container = $container; $this->resource = $resource; $this->context = $context ?: new RequestContext(); + $this->logger = $logger; $this->setOptions($options); }