10000 [FrameworkBundle][5.4] Remove fileLinkFormat property from DebugHandl… · symfony/symfony@974bae9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 974bae9

Browse files
committed
[FrameworkBundle][5.4] Remove fileLinkFormat property from DebugHandlersListener
1 parent c1c973c commit 974bae9

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/debug_prod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
null, // Log levels map for enabled error levels
2626
param('debug.error_handler.throw_at'),
2727
param('kernel.debug'),
28-
service('debug.file_link_formatter'),
2928
param('kernel.debug'),
3029
service('monolog.logger.deprecation')->nullOnInvalid(),
30+
service('debug.file_link_formatter'),
3131
])
3232
->tag('kernel.event_subscriber')
3333
->tag('monolog.logger', ['channel' => 'php'])

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class DebugHandlersListener implements EventSubscriberInterface
3939
private $levels;
4040
private $throwAt;
4141
private $scream;
42-
private $fileLinkFormat;
4342
private $scope;
4443
private $firstCall = true;
4544
private $hasTerminatedWithException;
@@ -49,11 +48,15 @@ class DebugHandlersListener implements EventSubscriberInterface
4948
* @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants
5049
* @param int|null $throwAt Thrown errors in a bit field of E_* constants, or null to keep the current value
5150
* @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
5351
* @param bool $scope Enables/disables scoping mode
52+
* @param string|FileLinkFormatter|null $fileLinkFormat The format for links to source files
5453
*/
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)
54+
public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, $scope = true, $deprecationLogger = null)
5655
{
56+
if (!is_bool($scope)) {
57+
trigger_deprecation('symfony/http-kernel', '5.4', 'Passing a $fileLinkFormat is deprecated.');
58+
}
59+
5760
$handler = set_exception_handler('var_dump');
5861
$this->earlyHandler = \is_array($handler) ? $handler[0] : null;
5962
restore_exception_handler();
@@ -63,7 +66,6 @@ public function __construct(callable $exceptionHandler = null, LoggerInterface $
6366
$this->levels = $levels ?? \E_ALL;
6467
$this->throwAt = \is_int($throwAt) ? $throwAt : (null === $throwAt ? null : ($throwAt ? \E_ALL : null));
6568
$this->scream = $scream;
66-
$this->fileLinkFormat = $fileLinkFormat;
6769
$this->scope = $scope;
6870
$this->deprecationLogger = $deprecationLogger;
6971
}

src/Symfony/Component/HttpKernel/Tests/EventListener/DebugHandlersListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function testLevelsAssignedToLoggers(bool $hasLogger, bool $hasDeprecatio
219219
->method('setDefaultLogger')
220220
->withConsecutive(...$expectedCalls);
221221

222-
$sut = new DebugHandlersListener(null, $logger, $levels, null, true, null, true, $deprecationLogger);
222+
$sut = new DebugHandlersListener(null, $logger, $levels, null, true, true, $deprecationLogger);
223223
$prevHander = set_exception_handler([$handler, 'handleError']);
224224

225225
try {

0 commit comments

Comments
 (0)
0