aboutsummaryrefslogtreecommitdiff
path: root/app/Models/CategoryDAO.php
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2023-04-07 12:32:10 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-07 12:32:10 +0200
commitd23d10bcde1a9b86c784d58b891f61e740e0124e (patch)
tree6f907e5d13a04832b3350286b1b847fbb3842ee7 /app/Models/CategoryDAO.php
parent6c01e4e7d6c177ac345c826059e585bffdd1d517 (diff)
Phpstan Level6 for View.php (#5269)
* Remarque's from Alkarex * indentation * indentation * Apply suggestions from code review Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Remarque's from Alkarex * A few improvements * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Fixes and improvments * Fix getTagsForEntry --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Models/CategoryDAO.php')
-rw-r--r--app/Models/CategoryDAO.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index dd97bd6cc..a67567f33 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -281,7 +281,8 @@ SQL;
return $categories;
}
- public function listCategories($prePopulateFeeds = true, $details = false) {
+ /** @return array<FreshRSS_Category>|false */
+ public function listCategories(bool $prePopulateFeeds = true, bool $details = false) {
if ($prePopulateFeeds) {
$sql = 'SELECT c.id AS c_id, c.name AS c_name, c.kind AS c_kind, c.`lastUpdate` AS c_last_update, c.error AS c_error, c.attributes AS c_attributes, '
. ($details ? 'f.* ' : 'f.id, f.name, f.url, f.website, f.priority, f.error, f.`cache_nbEntries`, f.`cache_nbUnreads`, f.ttl ')
@@ -435,13 +436,12 @@ SQL;
return $n;
}
- public static function daoToCategoryPrepopulated($listDAO) {
+ /**
+ * @param array<string,mixed> $listDAO
+ * @return array<int,FreshRSS_Category>
+ */
+ private static function daoToCategoryPrepopulated(array $listDAO) {
$list = array();
-
- if (!is_array($listDAO)) {
- $listDAO = array($listDAO);
- }
-
$previousLine = null;
$feedsDao = array();
$feedDao = FreshRSS_Factory::createFeedDAO();
@@ -481,7 +481,7 @@ SQL;
return $list;
}
- public static function daoToCategory($listDAO) {
+ private static function daoToCategory($listDAO) {
$list = array();
if (!is_array($listDAO)) {