Skip to content

Commit fb775f4

Browse files
minor #52209 [HttpKernel] Fix BC with FWB v5.3 (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- [HttpKernel] Fix BC with FWB v5.3 | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT The class in ``@internal`` but we reference it in FWB. In 5.4, it has an incompatible signature. This fixes the issue with accepting the previous type. Commits ------- 6a7159d [HttpKernel] Fix BC with FWB v5.3
2 parents c02610e + 6a7159d commit fb775f4

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)