From a19b56064d74ae871abd52903778e0d5c35af896 Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Sat, 15 Apr 2023 01:19:22 +0200 Subject: PHPstan level 6 for Category.php (#5298) * PHPstan level 6 for Category.php * Fix a few things * Minor fixes * A few more fixes --------- Co-authored-by: Luc Co-authored-by: Alexandre Alapetite --- app/Models/CategoryDAO.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/Models/CategoryDAO.php') diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index a67567f33..b103afb4e 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -258,14 +258,14 @@ SQL; } } - public function listSortedCategories($prePopulateFeeds = true, $details = false) { + public function listSortedCategories(bool $prePopulateFeeds = true, bool $details = false) { $categories = $this->listCategories($prePopulateFeeds, $details); if (!is_array($categories)) { return $categories; } - uasort($categories, static function ($a, $b) { + uasort($categories, static function (FreshRSS_Category $a, FreshRSS_Category $b) { $aPosition = $a->attributes('position'); $bPosition = $b->attributes('position'); if ($aPosition === $bPosition) { @@ -495,7 +495,7 @@ SQL; $cat->_id($dao['id']); $cat->_kind($dao['kind']); $cat->_lastUpdate($dao['lastUpdate'] ?? 0); - $cat->_error($dao['error'] ?? false); + $cat->_error($dao['error'] ?? 0); $cat->_attributes('', isset($dao['attributes']) ? $dao['attributes'] : ''); $list[$key] = $cat; } -- cgit v1.2.3