8000 [HttpKernel][DebugBundle] Always call CliDumper setDisplayOptions method · symfony/symfony@72e8450 · GitHub
[go: up one dir, main page]

Skip to content

Commit 72e8450

Browse files
committed
[HttpKernel][DebugBundle] Always call CliDumper setDisplayOptions method
1 parent 9b2a4db commit 72e8450

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
2121
use Symfony\Component\DependencyInjection\Reference;
2222
use Symfony\Component\VarDumper\Caster\ReflectionCaster;
23-
use Symfony\Component\VarDumper\Dumper\CliDumper;
2423
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
2524

2625
/**
@@ -85,13 +84,11 @@ public function load(array $configs, ContainerBuilder $container)
8584
;
8685
}
8786

88-
if (method_exists(CliDumper::class, 'setDisplayOptions')) {
89-
$container->getDefinition('var_dumper.cli_dumper')
90-
->addMethodCall('setDisplayOptions', [[
91-
'fileLinkFormat' => new Reference('debug.file_link_formatter', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE),
92-
]])
93-
;
94-
}
87+
$container->getDefinition('var_dumper.cli_dumper')
88+
->addMethodCall('setDisplayOptions', [[
89+
'fileLinkFormat' => new Reference('debug.file_link_formatter', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE),
90+
]])
91+
;
9592

9693
if (!class_exists(Command::class) || !class_exists(ServerLogCommand::class)) {
9794
$container->removeDefinition('monolog.command.server_log');

src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ public function collect(Request $request, Response $response, \Throwable $except
122122
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
123123
} else {
124124
$dumper = new CliDumper('php://output', $this->charset);
125-
if (method_exists($dumper, 'setDisplayOptions')) {
126-
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
127-
}
125+
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
128126
}
129127

130128
foreach ($this->data as $dump) {
@@ -238,9 +236,7 @@ public function __destruct()
238236
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
239237
} else {
240238
$dumper = new CliDumper('php://output', $this->charset);
241-
if (method_exists($dumper, 'setDisplayOptions')) {
242-
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
243-
}
239+
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
244240
}
245241

246242
foreach ($this->data as $i => $dump) {

0 commit comments

Comments
 (0)
0