Skip to content

Commit 3e80b94

Browse files
committed
using OutputFormatterStyle to format links instead of doing it ourselves
1 parent 0f9c064 commit 3e80b94

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Util/MakerFileLinkFormatter.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\MakerBundle\Util;
1313

14+
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
1415
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
1516

1617
/**
@@ -40,14 +41,9 @@ public function makeLinkedPath(string $absolutePath, string $relativePath): stri
4041
return $relativePath;
4142
}
4243

43-
return $this->createLink(
44-
$relativePath,
45-
$formatted
46-
);
47-
}
44+
$outputFormatterStyle = new OutputFormatterStyle();
45+
$outputFormatterStyle->setHref($formatted);
4846

49-
private function createLink(string $text, string $href): string
50-
{
51-
return "\033]8;;{$href}\033\\{$text}\033]8;;\033\\";
47+
return $outputFormatterStyle->apply($relativePath);
5248
}
5349
}

0 commit comments

Comments
 (0)