|
15 | 15 | use Symfony\Component\Console\Attribute\AsCommand;
|
16 | 16 | use Symfony\Component\Console\Completion\CompletionInput;
|
17 | 17 | use Symfony\Component\Console\Completion\CompletionSuggestions;
|
18 |
| -use Symfony\Component\Console\Formatter\OutputFormatterStyle; |
19 | 18 | use Symfony\Component\Console\Input\InputArgument;
|
20 | 19 | use Symfony\Component\Console\Input\InputInterface;
|
21 | 20 | use Symfony\Component\Console\Input\InputOption;
|
|
34 | 33 | #[AsCommand(name: 'debug:autowiring', description: 'List classes/interfaces you can use for autowiring')]
|
35 | 34 | class DebugAutowiringCommand extends ContainerDebugCommand
|
36 | 35 | {
|
37 |
| - private bool $supportsHref; |
38 | 36 | private ?FileLinkFormatter $fileLinkFormatter;
|
39 | 37 |
|
40 | 38 | public function __construct(string $name = null, FileLinkFormatter $fileLinkFormatter = null)
|
41 | 39 | {
|
42 |
| - $this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref'); |
43 | 40 | $this->fileLinkFormatter = $fileLinkFormatter;
|
44 | 41 | parent::__construct($name);
|
45 | 42 | }
|
@@ -124,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
|
124 | 121 | }
|
125 | 122 |
|
126 | 123 | $serviceLine = sprintf('<fg=yellow>%s</>', $serviceId);
|
127 |
| - if ($this->supportsHref && '' !== $fileLink = $this->getFileLink($previousId)) { |
| 124 | + if ('' !== $fileLink = $this->getFileLink($previousId)) { |
128 | 125 | $serviceLine = substr($serviceId, \strlen($previousId));
|
129 | 126 | $serviceLine = sprintf('<fg=yellow;href=%s>%s</>', $fileLink, $previousId).('' !== $serviceLine ? sprintf('<fg=yellow>%s</>', $serviceLine) : '');
|
130 | 127 | }
|
|
0 commit comments