8000 Fixes from PR feedback · symfony/symfony@e8b62bb · GitHub
[go: up one dir, main page]

Skip to content

Commit e8b62bb

Browse files
committed
Fixes from PR feedback
1 parent f361cec commit e8b62bb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
<tag name="monolog.logger" channel="request" />
129129
<argument>%twig.exception_listener.controller%</argument>
130130
<argument type="service" id="logger" on-invalid="null" />
131-
<argument>%twig.exception_listener.http_status_codes_log_level%</argument>
131+
<argument>%framework.http_exception.log_levels%</argument>
132132
</service>
133133

134134
<service id="twig.controller.exception" class="Symfony\Bundle\TwigBundle\Controller\ExceptionController" public="true">

src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ class ExceptionListener implements EventSubscriberInterface
3131
{
3232
protected $controller;
3333
protected $logger;
34-
protected $httpStatusCodeLogLevel = array();
34+
protected $httpStatusCodeLogLevel;
3535

36-
public function __construct($controller, LoggerInterface $logger = null, $httpStatusCodeLogLevel = array())
36+
public function __construct($controller, LoggerInterface $logger = null, array $httpStatusCodeLogLevel = array())
3737
{
3838
$this->controller = $controller;
3939
$this->logger = $logger;
40-
if ($httpStatusCodeLogLevel && is_array($httpStatusCodeLogLevel)) {
41-
$this->httpStatusCodeLogLevel = $httpStatusCodeLogLevel;
42-
}
40+
$this->httpStatusCodeLogLevel = $httpStatusCodeLogLevel;
4341
}
4442

4543
public function logKernelException(GetResponseForExceptionEvent $event)
@@ -87,7 +85,7 @@ public static function getSubscribedEvents()
8785
);
8886
}
8987

90-
protected function getExceptionLogLevel(\Exception $exception)
88+
protected function getExceptionLogLevel(\Exception $exception): LogLevel
9189
{
9290
$logLevel = LogLevel::CRITICAL;
9391
if ($exception instanceof HttpExceptionInterface) {

0 commit comments

Comments
 (0)
0