diff --git a/src/Resources/templates/htmlTable.phtml b/src/Resources/templates/htmlTable.phtml index 40696b1..b26a51d 100644 --- a/src/Resources/templates/htmlTable.phtml +++ b/src/Resources/templates/htmlTable.phtml @@ -224,7 +224,15 @@ - + + + + + + + + + diff --git a/src/Violation/Renderer/Html/Renderer.php b/src/Violation/Renderer/Html/Renderer.php index c85396b..5b03149 100644 --- a/src/Violation/Renderer/Html/Renderer.php +++ b/src/Violation/Renderer/Html/Renderer.php @@ -30,6 +30,10 @@ class Renderer implements RendererInterface * @var Filesystem */ private $fileSystem; + /** + * @var string + */ + private $fileLinkFormat; /** * @param MessageHelper $messageHelper @@ -44,6 +48,7 @@ public function __construct( $this->messageHelper = $messageHelper; $this->fileSystem = $filesystem; $this->outputFilename = $outputFilename; + $this->fileLinkFormat = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); } /** @@ -63,6 +68,9 @@ public function renderViolations(array $violations, array $errors) $fileViolation['message'] = $this->messageHelper->getViolationMessage($violation); $fileViolation['line'] = $violation->getLine(); $fileViolation['comment'] = $violation->getComment(); + if ($this->fileLinkFormat) { + $fileViolation['link'] = strtr($this->fileLinkFormat, array('%f' => $key, '%l' => $fileViolation['line'])); + } $orderedViolations[$key][] = $fileViolation; }