17
17
use Symfony \Component \Console \Output \ConsoleOutputInterface ;
18
18
use Symfony \Component \ErrorHandler \ErrorHandler ;
19
19
use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
20
- use Symfony \Component \HttpKernel \Debug \FileLinkFormatter ;
21
20
use Symfony \Component \HttpKernel \Event \KernelEvent ;
22
21
use Symfony \Component \HttpKernel \KernelEvents ;
23
22
@@ -39,21 +38,25 @@ class DebugHandlersListener implements EventSubscriberInterface
39
38
private $ levels ;
40
39
private $ throwAt ;
41
40
private $ scream ;
42
- private $ fileLinkFormat ;
43
41
private $ scope ;
44
42
private $ firstCall = true ;
45
43
private $ hasTerminatedWithException ;
46
44
47
45
/**
48
- * @param callable|null $exceptionHandler A handler that must support \Throwable instances that will be called on Exception
49
- * @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants
50
- * @param int|null $throwAt Thrown errors in a bit field of E_* constants, or null to keep the current value
51
- * @param bool $scream Enables/disables screaming mode, where even silenced errors are logged
52
- * @param string|FileLinkFormatter|null $fileLinkFormat The format for links to source files
53
- * @param bool $scope Enables/disables scoping mode
46
+ * @param callable|null $exceptionHandler A handler that must support \Throwable instances that will be called on Exception
47
+ * @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants
48
+ * @param int|null $throwAt Thrown errors in a bit field of E_* constants, or null to keep the current value
49
+ * @param bool $scream Enables/disables screaming mode, where even silenced errors are logged
50
+ * @param bool $scope Enables/disables scoping mode
54
51
*/
55
- public function __construct (callable $ exceptionHandler = null , LoggerInterface $ logger = null , $ levels = \E_ALL , ?int $ throwAt = \E_ALL , bool $ scream = true , $ fileLinkFormat = null , bool $ scope = true , LoggerInterface $ deprecationLogger = null )
52
+ public function __construct (callable $ exceptionHandler = null , LoggerInterface $ logger = null , $ levels = \E_ALL , ?int $ throwAt = \E_ALL , bool $ scream = true , $ scope = true , $ deprecationLogger = null , $ fileLinkFormat = null )
56
53
{
54
+ if (!\is_bool ($ scope )) {
55
+ trigger_deprecation ('symfony/http-kernel ' , '5.4 ' , 'Passing a $fileLinkFormat is deprecated. ' );
56
+ $ scope = $ deprecationLogger ;
57
+ $ deprecationLogger = $ fileLinkFormat ;
58
+ }
59
+
57
60
$ handler = set_exception_handler ('var_dump ' );
58
61
$ this ->earlyHandler = \is_array ($ handler ) ? $ handler [0 ] : null ;
59
62
restore_exception_handler ();
@@ -63,7 +66,6 @@ public function __construct(callable $exceptionHandler = null, LoggerInterface $
63
66
$ this ->levels = $ levels ?? \E_ALL ;
64
67
$ this ->throwAt = \is_int ($ throwAt ) ? $ throwAt : (null === $ throwAt ? null : ($ throwAt ? \E_ALL : null ));
65
68
$ this ->scream = $ scream ;
66
- $ this ->fileLinkFormat = $ fileLinkFormat ;
67
69
$ this ->scope = $ scope ;
68
70
$ this ->deprecationLogger = $ deprecationLogger ;
69
71
}
0 commit comments