From c72914bba2363e436574204b3d6093a6f3cfce89 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 28 Apr 2023 14:01:11 +0200 Subject: PHPStan Level 7 for more DAO PDO (#5328) * PHPStan Level 7 for more DAO PDO With new function to address common type and check problems * A bit more * PHPStan Level 7 for FreshRSS_Entry --- p/api/greader.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'p/api/greader.php') diff --git a/p/api/greader.php b/p/api/greader.php index f1cb7d615..34b74fd19 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -746,7 +746,7 @@ final class GReaderAPI { $entryDAO = FreshRSS_Factory::createEntryDao(); $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, $continuation, $searches); - if ($ids === false) { + if ($ids == null) { self::internalServerError(); } @@ -898,13 +898,15 @@ final class GReaderAPI { $categoryDAO = FreshRSS_Factory::createCategoryDao(); $cat = $categoryDAO->searchByName($s); if ($cat != null) { - $categoryDAO->updateCategory($cat->id(), array('name' => $dest)); + $categoryDAO->updateCategory($cat->id(), [ + 'name' => $dest, 'kind' => $cat->kind(), 'attributes' => $cat->attributes() + ]); exit('OK'); } else { $tagDAO = FreshRSS_Factory::createTagDao(); $tag = $tagDAO->searchByName($s); if ($tag != null) { - $tagDAO->updateTag($tag->id(), array('name' => $dest)); + $tagDAO->updateTagName($tag->id(), $dest); exit('OK'); } } -- cgit v1.2.3