Skip to content

Commit

Permalink
Helpers::editorLink: line is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 24, 2015
1 parent 0fe4a0b commit f88b73d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Tracy/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Helpers
* Returns HTML link to editor.
* @return string
*/
public static function editorLink($file, $line)
public static function editorLink($file, $line = NULL)
{
if ($editor = self::editorUri($file, $line)) {
$dir = dirname(strtr($file, '/', DIRECTORY_SEPARATOR));
Expand All @@ -34,7 +34,7 @@ public static function editorLink($file, $line)
}
return self::formatHtml('<a href="%" title="%">%<b>%</b>%</a>',
$editor,
"$file:$line",
$file . ($line ? ":$line" : ''),
rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR,
basename($file),
$line ? ":$line" : ''
Expand All @@ -49,10 +49,10 @@ public static function editorLink($file, $line)
* Returns link to editor.
* @return string
*/
public static function editorUri($file, $line)
public static function editorUri($file, $line = NULL)
{
if (Debugger::$editor && $file && is_file($file)) {
return strtr(Debugger::$editor, array('%file' => rawurlencode($file), '%line' => (int) $line));
return strtr(Debugger::$editor, array('%file' => rawurlencode($file), '%line' => $line ? (int) $line : ''));
}
}

Expand Down

0 comments on commit f88b73d

Please sign in to comment.