Reduce undeeded use of elvis operator ?: (#7204)

This commit is contained in:
Alexandre Alapetite
2025-01-10 08:13:09 +01:00
committed by GitHub
parent 3280ec617f
commit 5368f38753
23 changed files with 71 additions and 74 deletions

View File

@@ -35,7 +35,7 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
$catDAO = FreshRSS_Factory::createCategoryDao();
$catDAO->checkDefault();
$this->view->categories = $catDAO->listSortedCategories(false) ?: [];
$this->view->categories = $catDAO->listSortedCategories(prePopulateFeeds: false);
FreshRSS_View::prependTitle(_t('admin.stats.title') . ' · ');
}
@@ -127,7 +127,7 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
FreshRSS_View::appendScript(Minz_Url::display('/scripts/feed.js?' . @filemtime(PUBLIC_PATH . '/scripts/feed.js')));
$feed_dao = FreshRSS_Factory::createFeedDao();
$statsDAO = FreshRSS_Factory::createStatsDAO();
$feeds = $statsDAO->calculateFeedLastDate() ?: [];
$feeds = $statsDAO->calculateFeedLastDate();
$idleFeeds = [
'last_5_year' => [],
'last_3_year' => [],
@@ -223,7 +223,7 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
$id = null;
}
$this->view->categories = $categoryDAO->listCategories(true) ?: [];
$this->view->categories = $categoryDAO->listCategories(prePopulateFeeds: true);
$this->view->feed = $id === null ? FreshRSS_Feed::default() : ($feedDAO->searchById($id) ?? FreshRSS_Feed::default());
$this->view->days = $statsDAO->getDays();
$this->view->months = $statsDAO->getMonths();