aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-04-17 08:30:21 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-17 08:30:21 +0200
commitf3760f138dcbaf7a2190336a0378cf1b2190c9f5 (patch)
tree6fac8fbf9efd7aa74a8e3970ab70ccf85287b2cd /app/views
parent41fa4e746df8c2e2399ed753b4994ca85cb21358 (diff)
Complete PHPStan Level 6 (#5305)
* Complete PHPStan Level 6 Fix https://github.com/FreshRSS/FreshRSS/issues/4112 And initiate PHPStan Level 7 * PHPStan Level 6 for tests * Use phpstan/phpstan-phpunit * Update to PHPStan version 1.10 * Fix mixed bug * Fix mixed return bug * Fix paginator bug * Fix FreshRSS_UserConfiguration * A couple more Minz_Configuration bug fixes * A few trivial PHPStan Level 7 fixes * A few more simple PHPStan Level 7 * More files passing PHPStan Level 7 Add interface to replace removed class from https://github.com/FreshRSS/FreshRSS/pull/5251 * A few more PHPStan Level 7 preparations * A few last details
Diffstat (limited to 'app/views')
-rw-r--r--app/views/helpers/export/articles.phtml2
-rw-r--r--app/views/helpers/export/opml.phtml6
-rw-r--r--app/views/helpers/javascript_vars.phtml2
-rw-r--r--app/views/index/logs.phtml4
-rw-r--r--app/views/index/normal.phtml2
-rw-r--r--app/views/stats/idle.phtml2
6 files changed, 10 insertions, 8 deletions
diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml
index cc6a62377..60041339b 100644
--- a/app/views/helpers/export/articles.phtml
+++ b/app/views/helpers/export/articles.phtml
@@ -11,7 +11,7 @@ $articles = array(
'items' => array(),
);
-echo rtrim(json_encode($articles, $options), " ]}\n\r\t"), "\n";
+echo rtrim(json_encode($articles, $options) ?: '', " ]}\n\r\t"), "\n";
$first = true;
if (empty($this->entryIdsTagNames)) {
diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml
index 4df36b122..5acdff374 100644
--- a/app/views/helpers/export/opml.phtml
+++ b/app/views/helpers/export/opml.phtml
@@ -4,7 +4,7 @@
* @param array<FreshRSS_Feed> $feeds
* @return array<array<string,string|null>>
*/
-function feedsToOutlines($feeds, bool $excludeMutedFeeds = false): array {
+function feedsToOutlines(array $feeds, bool $excludeMutedFeeds = false): array {
$outlines = [];
foreach ($feeds as $feed) {
if ($feed->mute() && $excludeMutedFeeds) {
@@ -98,4 +98,6 @@ if (!empty($this->feeds)) {
}
$libopml = new \marienfressinaud\LibOpml\LibOpml(true);
-echo $libopml->render($opml_array);
+$opml = $libopml->render($opml_array);
+/** @var string $opml */
+echo $opml;
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index e108f5a34..03ed96a9e 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -72,4 +72,4 @@ echo htmlspecialchars(json_encode(array(
'unread' => rawurlencode(_i('unread')),
),
'extensions' => $extData,
-), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES, 'UTF-8');
+), JSON_UNESCAPED_UNICODE) ?: '', ENT_NOQUOTES, 'UTF-8');
diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml
index 54b7e1c6b..42be022d6 100644
--- a/app/views/index/logs.phtml
+++ b/app/views/index/logs.phtml
@@ -14,7 +14,7 @@
?>
<?php if (!empty($items)) { ?>
- <?php $this->logsPaginator->render('logs_pagination.phtml', 0); ?>
+ <?php $this->logsPaginator->render('logs_pagination.phtml'); ?>
<div id="loglist-wrapper" class="table-wrapper">
<table id="loglist">
<thead>
@@ -41,7 +41,7 @@
</tbody>
</table>
</div>
- <?php $this->logsPaginator->render('logs_pagination.phtml', 0); ?>
+ <?php $this->logsPaginator->render('logs_pagination.phtml'); ?>
diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml
index 02b336bf7..ede772a78 100644
--- a/app/views/index/normal.phtml
+++ b/app/views/index/normal.phtml
@@ -40,7 +40,7 @@ $today = @strtotime('today');
// We most likely already have the feed object in cache
$this->feed = FreshRSS_CategoryDAO::findFeed($this->categories, $this->entry->feedId());
if ($this->feed == null) {
- $this->feed = $this->entry->feed();
+ $this->feed = $this->entry->feed() ?: null;
if ($this->feed == null) {
$this->feed = FreshRSS_Feed::example();
}
diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml
index fcab1e8e3..d94256860 100644
--- a/app/views/stats/idle.phtml
+++ b/app/views/stats/idle.phtml
@@ -45,7 +45,7 @@
<li class="item feed<?= $error_class, $empty_class, $mute_class ?>" title="<?= $error_title, $empty_title ?>">
<a class="configure open-slider" href="<?= _url('stats', 'feed', 'id', $feedInPeriod['id'], 'sub', 'idle') ?>" title="<?= _t('gen.action.manage') ?>"><?= _i('configure') ?></a>
<?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $feedInPeriod['favicon'] ?>" alt="✇" loading="lazy" /><?php endif; ?>
- <span title="<?= timestamptodate($feedInPeriod['last_date'], false) ?>"><?= $feedInPeriod['name'] ?>
+ <span title="<?= timestamptodate((int)($feedInPeriod['last_date']), false) ?>"><?= $feedInPeriod['name'] ?>
(<?= _t('admin.stats.number_entries', $feedInPeriod['nb_articles']) ?>)</span>
</li>
<?php } ?>