aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-01-10 08:13:09 +0100
committerGravatar GitHub <noreply@github.com> 2025-01-10 08:13:09 +0100
commit5368f38753a3e655ed3d7d7dfc7af2cc22de7980 (patch)
treedecb975aa750660cea965bf61399df2335493b9d /app/Controllers/feedController.php
parent3280ec617f8081bf0d5349e441ae564a42fdc500 (diff)
Reduce undeeded use of elvis operator ?: (#7204)
Diffstat (limited to 'app/Controllers/feedController.php')
-rwxr-xr-xapp/Controllers/feedController.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index cc321aa49..4d64b40b5 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -337,7 +337,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
FreshRSS_View::prependTitle(_t('sub.feed.title_add') . ' ยท ');
$catDAO = FreshRSS_Factory::createCategoryDao();
- $this->view->categories = $catDAO->listCategories(false) ?: [];
+ $this->view->categories = $catDAO->listCategories(prePopulateFeeds: false);
$this->view->feed = new FreshRSS_Feed($url);
try {
// We try to get more information about the feed.
@@ -423,12 +423,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
} else {
$feeds = $feedDAO->listFeedsOrderUpdate(-1);
-
// Hydrate category for each feed to avoid that each feed has to make an SQL request
- $categories = [];
- foreach ($catDAO->listCategories(false, false) as $category) {
- $categories[$category->id()] = $category;
- }
+ $categories = $catDAO->listCategories(prePopulateFeeds: false, details: false);
foreach ($feeds as $feed) {
$category = $categories[$feed->categoryId()] ?? null;
if ($category !== null) {
@@ -576,7 +572,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$mark_updated_article_unread = $feed->attributeBoolean('mark_updated_article_unread') ?? FreshRSS_Context::userConf()->mark_updated_article_unread;
// For this feed, check existing GUIDs already in database.
- $existingHashForGuids = $entryDAO->listHashForFeedGuids($feed->id(), $newGuids) ?: [];
+ $existingHashForGuids = $entryDAO->listHashForFeedGuids($feed->id(), $newGuids);
/** @var array<string,bool> $newGuids */
$newGuids = [];