Skip to content

Commit 2dc9281

Browse files
committed
[VarDumper][FrameworkBundle] Remove checking if OutputFormatterStyle setHref method exist
1 parent d2a830e commit 2dc9281

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Command/DebugAutowiringCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\Console\Attribute\AsCommand;
1616
use Symfony\Component\Console\Completion\CompletionInput;
1717
use Symfony\Component\Console\Completion\CompletionSuggestions;
18-
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
1918
use Symfony\Component\Console\Input\InputArgument;
2019
use Symfony\Component\Console\Input\InputInterface;
2120
use Symfony\Component\Console\Input\InputOption;
@@ -34,12 +33,10 @@
3433
#[AsCommand(name: 'debug:autowiring', description: 'List classes/interfaces you can use for autowiring')]
3534
class DebugAutowiringCommand extends ContainerDebugCommand
3635
{
37-
private bool $supportsHref;
3836
private ?FileLinkFormatter $fileLinkFormatter;
3937

4038
public function __construct(string $name = null, FileLinkFormatter $fileLinkFormatter = null)
4139
{
42-
$this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref');
4340
$this->fileLinkFormatter = $fileLinkFormatter;
4441
parent::__construct($name);
4542
}
@@ -124,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
124121
}
125122

126123
$serviceLine = sprintf('<fg=yellow>%s</>', $serviceId);
127-
if ($this->supportsHref && '' !== $fileLink = $this->getFileLink($previousId)) {
124+
if ('' !== $fileLink = $this->getFileLink($previousId)) {
128125
$serviceLine = substr($serviceId, \strlen($previousId));
129126
$serviceLine = sprintf('<fg=yellow;href=%s>%s</>', $fileLink, $previousId).('' !== $serviceLine ? sprintf('<fg=yellow>%s</>', $serviceLine) : '');
130127
}

0 commit comments

Comments
 (0)