aboutsummaryrefslogtreecommitdiff
path: root/app/views/stats/index.phtml
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-04-28 14:01:11 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-28 14:01:11 +0200
commitc72914bba2363e436574204b3d6093a6f3cfce89 (patch)
tree377008a7393e4d80e4c8659f27dd42c0ccbab382 /app/views/stats/index.phtml
parent26e2a703125ffe1d0d2746b0e5ea3491b627832c (diff)
PHPStan Level 7 for more DAO PDO (#5328)
* PHPStan Level 7 for more DAO PDO With new function to address common type and check problems * A bit more * PHPStan Level 7 for FreshRSS_Entry
Diffstat (limited to 'app/views/stats/index.phtml')
-rw-r--r--app/views/stats/index.phtml30
1 files changed, 17 insertions, 13 deletions
diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml
index 2d7e941b6..a9958ee54 100644
--- a/app/views/stats/index.phtml
+++ b/app/views/stats/index.phtml
@@ -24,29 +24,29 @@
<tbody>
<tr>
<th><?= _t('admin.stats.status_total') ?></th>
- <td class="numeric"><?= format_number($this->repartition['main_stream']['total']) ?></td>
- <td class="numeric"><?= format_number($this->repartition['all_feeds']['total']) ?></td>
+ <td class="numeric"><?= format_number($this->repartitions['main_stream']['total'] ?? -1) ?></td>
+ <td class="numeric"><?= format_number($this->repartitions['all_feeds']['total'] ?? -1) ?></td>
</tr>
<tr>
<th><?= _t('admin.stats.status_read') ?></th>
- <td class="numeric"><?= format_number($this->repartition['main_stream']['count_reads']) ?></td>
- <td class="numeric"><?= format_number($this->repartition['all_feeds']['count_reads']) ?></td>
+ <td class="numeric"><?= format_number($this->repartitions['main_stream']['count_reads'] ?? -1) ?></td>
+ <td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_reads'] ?? -1) ?></td>
</tr>
<tr>
<th><?= _t('admin.stats.status_unread') ?></th>
- <td class="numeric"><?= format_number($this->repartition['main_stream']['count_unreads']) ?></td>
- <td class="numeric"><?= format_number($this->repartition['all_feeds']['count_unreads']) ?></td>
+ <td class="numeric"><?= format_number($this->repartitions['main_stream']['count_unreads'] ?? -1) ?></td>
+ <td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_unreads'] ?? -1) ?></td>
</tr>
<tr>
<th><?= _t('admin.stats.status_favorites') ?></th>
- <td class="numeric"><?= format_number($this->repartition['main_stream']['count_favorites']) ?></td>
- <td class="numeric"><?= format_number($this->repartition['all_feeds']['count_favorites']) ?></td>
+ <td class="numeric"><?= format_number($this->repartitions['main_stream']['count_favorites'] ?? -1) ?></td>
+ <td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_favorites'] ?? -1) ?></td>
</tr>
</tbody>
</table>
- </div><!--
+ </div>
- --><div class="stat half">
+ <div class="stat half">
<h2><?= _t('admin.stats.top_feed') ?></h2>
<table>
<thead>
@@ -58,14 +58,18 @@
</tr>
</thead>
<tbody>
- <?php foreach ($this->topFeed as $feed) { ?>
+ <?php foreach ($this->topFeed as $feed): ?>
<tr>
<td><a href="<?= _url('stats', 'repartition', 'id', $feed['id']) ?>"><?= $feed['name'] ?></a></td>
<td><?= $feed['category'] ?></td>
<td class="numeric"><?= format_number($feed['count']) ?></td>
- <td class="numeric"><?= format_number($feed['count'] / $this->repartition['all_feeds']['total'] * 100, 1) ?></td>
+ <td class="numeric"><?php
+ if (!empty($this->repartitions['all_feeds']['total'])) {
+ echo format_number($feed['count'] / $this->repartitions['all_feeds']['total'] * 100, 1);
+ }
+ ?></td>
</tr>
- <?php } ?>
+ <?php endforeach; ?>
</tbody>
</table>
</div>