aboutsummaryrefslogtreecommitdiff
path: root/app/Services
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/Services
parent3280ec617f8081bf0d5349e441ae564a42fdc500 (diff)
Reduce undeeded use of elvis operator ?: (#7204)
Diffstat (limited to 'app/Services')
-rw-r--r--app/Services/ExportService.php6
-rw-r--r--app/Services/ImportService.php2
2 files changed, 4 insertions, 4 deletions
diff --git a/app/Services/ExportService.php b/app/Services/ExportService.php
index e9acda614..69f0b3d2b 100644
--- a/app/Services/ExportService.php
+++ b/app/Services/ExportService.php
@@ -40,7 +40,7 @@ class FreshRSS_Export_Service {
public function generateOpml(): array {
$view = new FreshRSS_View();
$day = date('Y-m-d');
- $view->categories = $this->category_dao->listCategories(true, true) ?: [];
+ $view->categories = $this->category_dao->listCategories(prePopulateFeeds: true, details: true);
$view->excludeMutedFeeds = false;
return [
@@ -64,7 +64,7 @@ class FreshRSS_Export_Service {
*/
public function generateStarredEntries(string $type): array {
$view = new FreshRSS_View();
- $view->categories = $this->category_dao->listCategories(true) ?: [];
+ $view->categories = $this->category_dao->listCategories(prePopulateFeeds: true);
$day = date('Y-m-d');
$view->list_title = _t('sub.import_export.starred_list');
@@ -89,7 +89,7 @@ class FreshRSS_Export_Service {
*/
public function generateFeedEntries(int $feed_id, int $max_number_entries): ?array {
$view = new FreshRSS_View();
- $view->categories = $this->category_dao->listCategories(true) ?: [];
+ $view->categories = $this->category_dao->listCategories(prePopulateFeeds: true);
$feed = FreshRSS_Category::findFeed($view->categories, $feed_id);
if ($feed === null) {
diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php
index 142a0ce09..00bb89229 100644
--- a/app/Services/ImportService.php
+++ b/app/Services/ImportService.php
@@ -58,7 +58,7 @@ class FreshRSS_Import_Service {
// Get the categories by names so we can use this array to retrieve
// existing categories later.
- $categories = $this->catDAO->listCategories(false) ?: [];
+ $categories = $this->catDAO->listCategories(prePopulateFeeds: false);
$categories_by_names = [];
foreach ($categories as $category) {
$categories_by_names[$category->name()] = $category;