Skip to content

Commit 6a7159d

Browse files
[HttpKernel] Fix BC with FWB v5.3
1 parent c02610e commit 6a7159d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\HttpKernel\EventListener;
1313

14+
use Psr\Log\LoggerInterface;
1415
use Symfony\Component\Console\ConsoleEvents;
1516
use Symfony\Component\Console\Event\ConsoleEvent;
1617
use Symfony\Component\Console\Output\ConsoleOutputInterface;
@@ -37,10 +38,15 @@ class DebugHandlersListener implements EventSubscriberInterface
3738
private bool $hasTerminatedWithException = false;
3839

3940
/**
41+
* @param bool $webMode
4042
* @param callable|null $exceptionHandler A handler that must support \Throwable instances that will be called on Exception
4143
*/
42-
public function __construct(callable $exceptionHandler = null, bool $webMode = null)
44+
public function __construct(callable $exceptionHandler = null, bool|LoggerInterface $webMode = null)
4345
{
46+
if ($webMode instanceof LoggerInterface) {
47+
// BC with Symfony 5
48+
$webMode = null;
49+
}
4450
$handler = set_exception_handler('is_int');
4551
$this->earlyHandler = \is_array($handler) ? $handler[0] : null;
4652
restore_exception_handler();

0 commit comments

Comments
 (0)