1111
1212namespace Symfony \Component \VarDumper \Command \Descriptor ;
1313
14- use Symfony \Component \Console \Formatter \OutputFormatterStyle ;
1514use Symfony \Component \Console \Input \ArrayInput ;
1615use Symfony \Component \Console \Output \OutputInterface ;
1716use Symfony \Component \Console \Style \SymfonyStyle ;
@@ -29,12 +28,10 @@ class CliDescriptor implements DumpDescriptorInterface
2928{
3029 private $ dumper ;
3130 private $ lastIdentifier ;
32- private $ supportsHref ;
3331
3432 public function __construct (CliDumper $ dumper )
3533 {
3634 $ this ->dumper = $ dumper ;
37- $ this ->supportsHref = method_exists (OutputFormatterStyle::class, 'setHref ' );
3835 }
3936
4037 public function describe (OutputInterface $ output , Data $ data , array $ context , int $ clientId ): void
@@ -66,8 +63,7 @@ public function describe(OutputInterface $output, Data $data, array $context, in
6663 if (isset ($ context ['source ' ])) {
6764 $ source = $ context ['source ' ];
6865 $ sourceInfo = sprintf ('%s on line %d ' , $ source ['name ' ], $ source ['line ' ]);
69- $ fileLink = $ source ['file_link ' ] ?? null ;
70- if ($ this ->supportsHref && $ fileLink ) {
66+ if ($ fileLink = $ source ['file_link ' ] ?? null ) {
7167 $ sourceInfo = sprintf ('<href=%s>%s</> ' , $ fileLink , $ sourceInfo );
7268 }
7369 $ rows [] = ['source ' , $ sourceInfo ];
@@ -77,11 +73,6 @@ public function describe(OutputInterface $output, Data $data, array $context, in
7773
7874 $ io ->table ([], $ rows );
7975
80- if (!$ this ->supportsHref && isset ($ fileLink )) {
81- $ io ->writeln (['<info>Open source in your IDE/browser:</info> ' , $ fileLink ]);
82- $ io ->newLine ();
83- }
84-
8576 $ this ->dumper ->dump ($ data );
8677 $ io ->newLine ();
8778 }
0 commit comments