aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers/index
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-09-11 17:14:53 +0200
committerGravatar GitHub <noreply@github.com> 2024-09-11 17:14:53 +0200
commitdfac9f5813df7d4c7c812c381364c8898333f559 (patch)
tree978496d0a8d8b0d6b5dbe836c6829296133b337c /app/views/helpers/index
parent31c8846791d4b5316fbc790202f79545c012f9c2 (diff)
PHPStan booleansInConditions (#6793)
* PHPStan booleansInConditions * Uniformisation
Diffstat (limited to 'app/views/helpers/index')
-rw-r--r--app/views/helpers/index/article.phtml9
-rw-r--r--app/views/helpers/index/normal/entry_bottom.phtml3
-rw-r--r--app/views/helpers/index/normal/entry_header.phtml3
-rw-r--r--app/views/helpers/index/tags.phtml3
4 files changed, 15 insertions, 3 deletions
diff --git a/app/views/helpers/index/article.phtml b/app/views/helpers/index/article.phtml
index bdc108f1e..0a9c75bcd 100644
--- a/app/views/helpers/index/article.phtml
+++ b/app/views/helpers/index/article.phtml
@@ -4,6 +4,9 @@
/** @var FreshRSS_View $this */
$entry = $this->entry;
$feed = $this->feed;
+ if ($feed === null || $entry === null) {
+ return;
+ }
?>
<article class="flux_content" dir="auto">
<div class="content <?= FreshRSS_Context::userConf()->content_width ?>">
@@ -29,7 +32,7 @@
<div class="item manage">
<a class="bookmark" href="<?= Minz_Url::display($favoriteUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?= _i($entry->isFavorite() ? 'starred' : 'non-starred') ?></a>
</div>
- <?php } ?>
+ <?php } ?>
<?php } ?>
<div class="item">
<?php if (FreshRSS_Context::userConf()->show_feed_name === 't') { ?>
@@ -42,7 +45,7 @@
<?php
if (FreshRSS_Context::userConf()->topline_link && FreshRSS_Context::userConf()->show_article_icons == 't') { ?>
<div class="item link">
- <a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" class="item-element" title="<?= _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a>
+ <a target="_blank" rel="noreferrer" href="<?= $entry->link() ?>" class="item-element" title="<?= _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a>
</div>
<?php } ?>
</div>
@@ -93,7 +96,7 @@
<?php
if (FreshRSS_Context::userConf()->topline_link && FreshRSS_Context::userConf()->show_article_icons == 'a') { ?>
<div class="item link">
- <a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" class="item-element" title="<?= _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a>
+ <a target="_blank" rel="noreferrer" href="<?= $entry->link() ?>" class="item-element" title="<?= _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a>
</div>
<?php } ?>
</div>
diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml
index 1de8395bc..51c103a74 100644
--- a/app/views/helpers/index/normal/entry_bottom.phtml
+++ b/app/views/helpers/index/normal/entry_bottom.phtml
@@ -1,6 +1,9 @@
<?php
declare(strict_types=1);
/** @var FreshRSS_View $this */
+ if ($this->entry === null) {
+ return;
+ }
$bottomline_read = FreshRSS_Context::userConf()->bottomline_read;
$bottomline_favorite = FreshRSS_Context::userConf()->bottomline_favorite;
$bottomline_sharing = FreshRSS_Context::userConf()->bottomline_sharing && (count(FreshRSS_Context::userConf()->sharing) > 0);
diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml
index ecaf0f0d6..a2f8d00fc 100644
--- a/app/views/helpers/index/normal/entry_header.phtml
+++ b/app/views/helpers/index/normal/entry_header.phtml
@@ -11,6 +11,9 @@
$topline_date = FreshRSS_Context::userConf()->topline_date;
$topline_link = FreshRSS_Context::userConf()->topline_link;
$lazyload = FreshRSS_Context::userConf()->lazyload;
+ if ($this->feed === null || $this->entry === null) {
+ return;
+ }
?><ul class="horizontal-list flux_header website<?= $topline_website ?>" data-website-name="<?= $this->feed->name() ?>" data-article-authors="<?= implode(', ', $this->entry->authors()) ?>"><?php
if (FreshRSS_Auth::hasAccess()) {
if ($topline_read) {
diff --git a/app/views/helpers/index/tags.phtml b/app/views/helpers/index/tags.phtml
index 8f67784dd..3308bd7e9 100644
--- a/app/views/helpers/index/tags.phtml
+++ b/app/views/helpers/index/tags.phtml
@@ -1,6 +1,9 @@
<?php
declare(strict_types=1);
/** @var FreshRSS_View $this */
+ if ($this->entry === null) {
+ return;
+ }
[$firstTags,$remainingTags] = $this->entry->tagsFormattingHelper();
?>
<div class="tags">