<?php

declare(strict_types=1);

namespace Packetery\Tracy;

/** @var int[] $data */
?>
<h1>Errors</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>
	<td><pre><?= Helpers::escapeHtml($message), ' in ', Helpers::editorLink($file, (int) $line) ?></pre></td>
</tr>
<?php endforeach ?>
</table>
</div>
