From 78f4f88cdd3513ee4cef8c3a2b7e9122f48e368e Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Sun, 5 Nov 2017 17:04:27 +0100 Subject: [PATCH] [FrameworkBundle] Allow to pass a logger instance to the Router --- src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 5 +++++ .../FrameworkBundle/Resources/config/routing.xml | 2 ++ .../Bundle/FrameworkBundle/Routing/Router.php | 13 ++++++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 7160a372af5ba..40b0281831cac 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 f6bd479d8e194..81af5c397c863 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 0148dbf73d86a..232b39283cac1 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); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy