Skip to content

Commit

Permalink
Not displaying colon if file name empty
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgfeller committed Apr 23, 2024
1 parent 7ce16e6 commit 66a6c94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Renderer/ErrorDetailsPageRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ private function getTraceEntriesHtml(array $traceEntries): string
$traceContent .= ')
</td>
<td class="stack-trace-file-name ' . $this->html($entry['nonVendorClass']) . '">' .
$this->html($entry['fileName']) .
':<span class="lineSpan">' . $this->html($entry['line']) . '</span>
$this->html($entry['fileName']) . (!empty($entry['fileName']) ? ':' : '') .
'<span class="lineSpan">' . $this->html($entry['line']) . '</span>
</td>
</tr>';
}
Expand Down
3 changes: 2 additions & 1 deletion src/Renderer/JsonErrorRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ private function getTraceEntriesJsonArray(array $traceEntries): array
$truncatedArgsString = implode(', ', $truncatedArgs);
$isNotVendor = $entry['nonVendorClass'] === 'non-vendor';
$traceJson[$key] = "#$key " . ($isNotVendor ? '(src) ' : '(vendor) ') . $entry['classAndFunction'] .
'(' . $truncatedArgsString . ') called in (file)' . $entry['fileName'] . ':' . $entry['line'] . ']';
'(' . $truncatedArgsString . ')' .
(!empty($entry['fileName']) ? ' called in (file)' . $entry['fileName'] . ':' . $entry['line'] : '');
}

return $traceJson;
Expand Down

0 comments on commit 66a6c94

Please sign in to comment.