Skip to content

Commit

Permalink
Make editor links clickable for terminals supporting hrefs
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek authored and ondrejmirtes committed Feb 12, 2022
1 parent 425dee7 commit b678968
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Command/ErrorFormatter/TableErrorFormatter.php
Expand Up @@ -74,7 +74,8 @@ public function formatErrors(
$message .= "\n💡 " . $tip;
}
if (is_string($this->editorUrl)) {
$message .= "\n✏️ " . str_replace(['%file%', '%line%'], [$error->getTraitFilePath() ?? $error->getFilePath(), (string) $error->getLine()], $this->editorUrl);
$url = str_replace(['%file%', '%line%'], [$error->getTraitFilePath() ?? $error->getFilePath(), (string) $error->getLine()], $this->editorUrl);
$message .= "\n✏️ <href=" . $url . '>' . $url . '</>';
}
$rows[] = [
(string) $error->getLine(),
Expand Down

0 comments on commit b678968

Please sign in to comment.