File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/Symfony/Component/HttpKernel/EventListener Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \HttpKernel \EventListener ;
13
13
14
+ use Psr \Log \LoggerInterface ;
14
15
use Symfony \Component \Console \ConsoleEvents ;
15
16
use Symfony \Component \Console \Event \ConsoleEvent ;
16
17
use Symfony \Component \Console \Output \ConsoleOutputInterface ;
@@ -37,10 +38,15 @@ class DebugHandlersListener implements EventSubscriberInterface
37
38
private bool $ hasTerminatedWithException = false ;
38
39
39
40
/**
41
+ * @param bool $webMode
40
42
* @param callable|null $exceptionHandler A handler that must support \Throwable instances that will be called on Exception
41
43
*/
42
- public function __construct (callable $ exceptionHandler = null , bool $ webMode = null )
44
+ public function __construct (callable $ exceptionHandler = null , bool | LoggerInterface $ webMode = null )
43
45
{
46
+ if ($ webMode instanceof LoggerInterface) {
47
+ // BC with Symfony 5
48
+ $ webMode = null ;
49
+ }
44
50
$ handler = set_exception_handler ('is_int ' );
45
51
$ this ->earlyHandler = \is_array ($ handler ) ? $ handler [0 ] : null ;
46
52
restore_exception_handler ();
You can’t perform that action at this time.
0 commit comments