From d23d10bcde1a9b86c784d58b891f61e740e0124e Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Fri, 7 Apr 2023 12:32:10 +0200 Subject: Phpstan Level6 for View.php (#5269) * Remarque's from Alkarex * indentation * indentation * Apply suggestions from code review Co-authored-by: Alexandre Alapetite * 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 Co-authored-by: Alexandre Alapetite --- app/Models/CategoryDAO.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'app/Models/CategoryDAO.php') 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|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 $listDAO + * @return array + */ + 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)) { -- cgit v1.2.3