aboutsummaryrefslogtreecommitdiff
path: root/app/views/index/normal.phtml
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-12-18 17:59:16 +0100
committerGravatar GitHub <noreply@github.com> 2023-12-18 17:59:16 +0100
commita80a5f48a16e7d232168a7aaa68e9a1804235ce1 (patch)
treea515b88592629dea7e83b96e26e2452d3f98a98e /app/views/index/normal.phtml
parent6bb45a87268157aab961a6a4a728d9a9bbe043b0 (diff)
Pass PHPStan level 8 (#5946)
* Pass PHPStan level 8 And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels * Revert wrong replace in comment * Fix PHPStan level 8 * Update PHPStan and other dev dependencies * Remove obsolete comment * noVariableVariables and towards bleedingEdge https://github.com/phpstan/phpstan-strict-rules https://phpstan.org/blog/what-is-bleeding-edge * More bleedingEdge * A bit more PHPStan level 9 * More PHPStan level 9 * Prepare for booleansInConditions Ignore int and null * Revert wrong line * More fixes * Fix keep_max_n_unread * Stricter attribute functions * Stricter callHooks and more PHPStan level 9 * More typing * A tiny more
Diffstat (limited to 'app/views/index/normal.phtml')
-rw-r--r--app/views/index/normal.phtml35
1 files changed, 19 insertions, 16 deletions
diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml
index 0d484f518..42c2e0072 100644
--- a/app/views/index/normal.phtml
+++ b/app/views/index/normal.phtml
@@ -11,10 +11,10 @@ call_user_func($this->callbackBeforeEntries, $this);
$display_today = true;
$display_yesterday = true;
$display_others = true;
-$hidePosts = !FreshRSS_Context::$user_conf->display_posts;
-$lazyload = FreshRSS_Context::$user_conf->lazyload;
-$content_width = FreshRSS_Context::$user_conf->content_width;
-$MAX_TAGS_DISPLAYED = FreshRSS_Context::$user_conf->show_tags_max;
+$hidePosts = !FreshRSS_Context::userConf()->display_posts;
+$lazyload = FreshRSS_Context::userConf()->lazyload;
+$content_width = FreshRSS_Context::userConf()->content_width;
+$MAX_TAGS_DISPLAYED = FreshRSS_Context::userConf()->show_tags_max;
$useKeepUnreadImportant = !FreshRSS_Context::isImportant() && !FreshRSS_Context::isFeed();
$today = @strtotime('today');
@@ -74,12 +74,15 @@ $today = @strtotime('today');
?>" data-priority="<?= $this->feed->priority()
?>"><?php
$this->renderHelper('index/normal/entry_header');
+ if ($this->feed === null) {
+ throw new FreshRSS_Context_Exception('Feed not initialised!');
+ }
$tags = null;
$firstTags = array();
$remainingTags = array();
- if (FreshRSS_Context::$user_conf->show_tags === 'h' || FreshRSS_Context::$user_conf->show_tags === 'f' || FreshRSS_Context::$user_conf->show_tags === 'b') {
+ if (FreshRSS_Context::userConf()->show_tags === 'h' || FreshRSS_Context::userConf()->show_tags === 'f' || FreshRSS_Context::userConf()->show_tags === 'b') {
$tags = $this->entry->tags();
if (!empty($tags)) {
if ($MAX_TAGS_DISPLAYED > 0) {
@@ -93,14 +96,14 @@ $today = @strtotime('today');
?><article class="flux_content" dir="auto">
<div class="content <?= $content_width ?>">
<header>
- <?php if (FreshRSS_Context::$user_conf->show_feed_name === 't') { ?>
+ <?php if (FreshRSS_Context::userConf()->show_feed_name === 't') { ?>
<div class="website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" title="<?= _t('gen.action.filter') ?>">
- <?php if (FreshRSS_Context::$user_conf->show_favicons): ?>
+ <?php if (FreshRSS_Context::userConf()->show_favicons): ?>
<img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php
endif; ?><span><?= $this->feed->name() ?></span></a>
</div>
<?php } ?>
- <?php if (FreshRSS_Context::$user_conf->show_tags === 'h' || FreshRSS_Context::$user_conf->show_tags === 'b') { ?>
+ <?php if (FreshRSS_Context::userConf()->show_tags === 'h' || FreshRSS_Context::userConf()->show_tags === 'b') { ?>
<div class="tags">
<?php
if (!empty($tags)) {
@@ -132,11 +135,11 @@ $today = @strtotime('today');
<?php
} ?>
<h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?= $this->entry->link() ?>" title="<?= _t('conf.shortcut.see_on_website')?>"><?= $this->entry->title() ?></a></h1>
- <?php if (FreshRSS_Context::$user_conf->show_author_date === 'h' || FreshRSS_Context::$user_conf->show_author_date === 'b') { ?>
+ <?php if (FreshRSS_Context::userConf()->show_author_date === 'h' || FreshRSS_Context::userConf()->show_author_date === 'b') { ?>
<div class="subtitle">
- <?php if (FreshRSS_Context::$user_conf->show_feed_name === 'a') { ?>
+ <?php if (FreshRSS_Context::userConf()->show_feed_name === 'a') { ?>
<div class="website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" title="<?= _t('gen.action.filter') ?>">
- <?php if (FreshRSS_Context::$user_conf->show_favicons): ?>
+ <?php if (FreshRSS_Context::userConf()->show_favicons): ?>
<img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php
endif; ?><span><?= $this->feed->name() ?></span></a>
</div>
@@ -164,8 +167,8 @@ $today = @strtotime('today');
echo $lazyload && $hidePosts ? lazyimg($this->entry->content(true)) : $this->entry->content(true);
?></div>
<?php
- $display_authors_date = FreshRSS_Context::$user_conf->show_author_date === 'f' || FreshRSS_Context::$user_conf->show_author_date === 'b';
- $display_tags = FreshRSS_Context::$user_conf->show_tags === 'f' || FreshRSS_Context::$user_conf->show_tags === 'b';
+ $display_authors_date = FreshRSS_Context::userConf()->show_author_date === 'f' || FreshRSS_Context::userConf()->show_author_date === 'b';
+ $display_tags = FreshRSS_Context::userConf()->show_tags === 'f' || FreshRSS_Context::userConf()->show_tags === 'b';
if ($display_authors_date || $display_tags) {
?>
@@ -173,9 +176,9 @@ $today = @strtotime('today');
<?php
if ($display_authors_date) { ?>
<div class="subtitle">
- <?php if (FreshRSS_Context::$user_conf->show_feed_name === 'a') { ?>
+ <?php if (FreshRSS_Context::userConf()->show_feed_name === 'a') { ?>
<div class="website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" title="<?= _t('gen.action.filter') ?>">
- <?php if (FreshRSS_Context::$user_conf->show_favicons): ?>
+ <?php if (FreshRSS_Context::userConf()->show_favicons): ?>
<img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php
endif; ?><span><?= $this->feed->name() ?></span></a>
</div>
@@ -266,4 +269,4 @@ $today = @strtotime('today');
<?= _i('close') ?>
</a>
-<?php if ($nbEntries > 0 && FreshRSS_Context::$user_conf->show_nav_buttons) $this->partial('nav_entries'); ?>
+<?php if ($nbEntries > 0 && FreshRSS_Context::userConf()->show_nav_buttons) $this->partial('nav_entries'); ?>