Add more type hints and work on some code formatting

This commit is contained in:
Alex Cabal 2024-11-08 13:50:59 -06:00
parent 06b82cdaaa
commit c3c588cc1b
35 changed files with 343 additions and 167 deletions

View file

@ -1,8 +1,14 @@
<?
/**
* @var string $label
* @var array<stdClass> $collections
*/
?>
<table class="download-list">
<caption aria-hidden="hidden">Scroll right </caption>
<thead>
<tr class="mid-header">
<th scope="col"><?= $label ?></th>
<th scope="col"><?= Formatter::EscapeHtml($label) ?></th>
<th scope="col">Ebooks</th>
<th scope="col">Updated</th>
<th scope="col" colspan="10">Ebook format</th>
@ -10,16 +16,15 @@
</thead>
<tbody>
<? foreach($collections as $collection){ ?>
<tr>
<td class="row-header"><a href="<?= $collection->Url ?>"><?= Formatter::EscapeHtml($collection->Label) ?></a></td>
<td class="number"><?= Formatter::EscapeHtml(number_format($collection->EbookCount)) ?></td>
<td class="number"><?= Formatter::EscapeHtml($collection->UpdatedString) ?></td>
<? foreach($collection->ZipFiles as $item){ ?>
<td class="download"><a href="<?= $item->Url ?>"><?= $item->Type ?></a></td>
<td>(<?= Formatter::EscapeHtml($item->Size) ?>)</td>
<? } ?>
</tr>
<tr>
<td class="row-header"><a href="<?= $collection->Url ?>"><?= Formatter::EscapeHtml($collection->Label) ?></a></td>
<td class="number"><?= Formatter::EscapeHtml(number_format($collection->EbookCount)) ?></td>
<td class="number"><?= Formatter::EscapeHtml($collection->UpdatedString) ?></td>
<? foreach($collection->ZipFiles as $item){ ?>
<td class="download"><a href="<?= $item->Url ?>"><?= $item->Type ?></a></td>
<td>(<?= Formatter::EscapeHtml($item->Size) ?>)</td>
<? } ?>
</tr>
<? } ?>
</tbody>
</table>