Skip to content

Commit

Permalink
bar: label 'Errors' => 'Warnings'
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 29, 2024
1 parent c59d76e commit c51b43a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
'prefer-arrow-callback': ['error'],
'arrow-parens': ['error'],
'arrow-spacing': ['error'],
'no-var': ['error']
'no-var': ['error'],
'prefer-const': ['error']
}
};
1 change: 1 addition & 0 deletions examples/exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<h1>Tracy: exception demo</h1>

<?php
$a++;

class DemoClass
{
Expand Down
3 changes: 1 addition & 2 deletions src/Tracy/Bar/panels/errors.panel.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ namespace Tracy;

/** @var int[] $data */
?>
<h1>Errors</h1>
<h1>Warnings</h1>

<div class="tracy-inner">
<table class="tracy-sortable">
<tr><th>Count</th><th>Error</th></tr>
<?php foreach ($data as $item => $count): [$file, $line, $message] = explode('|', $item, 3) ?>
<tr>
<td class="tracy-right"><?= $count ? "$count\xC3\x97" : '' ?></td>
Expand Down
2 changes: 1 addition & 1 deletion src/Tracy/Bar/panels/errors.tab.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ if (empty($data)) {
</style>
<span class="tracy-ErrorTab">
<svg viewBox="0 0 2048 2048"><path fill="#fff" d="M1152 1503v-190q0-14-9.5-23.5t-22.5-9.5h-192q-13 0-22.5 9.5t-9.5 23.5v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11h-220q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17h-1536q-34 0-63.5-17t-46.5-46q-37-63-2-126l768-1408q17-31 47-49t65-18 65 18 47 49z"/>
</svg><span class="tracy-label"><?= $sum = array_sum($data), $sum > 1 ? ' errors' : ' error' ?></span>
</svg><span class="tracy-label"><?= $sum = array_sum($data), $sum > 1 ? ' warnings' : ' warning' ?></span>
</span>
1 change: 0 additions & 1 deletion tests/Tracy/Debugger.warnings.html.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ register_shutdown_function(function () {
$panelContent = (string) DomQuery::fromHtml($rawContent)->find('#tracy-debug-panel-Tracy-errors')[0]['data-tracy-content'];
Assert::match(<<<'XX'
%A%<table class="tracy-sortable">
<tr><th>Count</th><th>Error</th></tr>
<tr>
<td class="tracy-right">1%a%</td>
<td><pre>PHP Notice: Only variables should be assigned by reference in %a%:%d%</a></pre></td>
Expand Down

0 comments on commit c51b43a

Please sign in to comment.