From 7c2da31418d3479b60c9c6b28cc595deda93d434 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 7 Feb 2022 00:56:45 +0100 Subject: More PHP type hints for Fever (#4202) * More PHP type hints for Fever Follow-up of https://github.com/FreshRSS/FreshRSS/pull/4201 Related to https://github.com/FreshRSS/FreshRSS/issues/4200 --- p/api/fever.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'p/api/fever.php') diff --git a/p/api/fever.php b/p/api/fever.php index 618df4fbf..beb0883e4 100644 --- a/p/api/fever.php +++ b/p/api/fever.php @@ -130,7 +130,14 @@ class FeverAPI const STATUS_OK = 1; const STATUS_ERR = 0; + /** + * @var FreshRSS_EntryDAO|null + */ private $entryDAO = null; + + /** + * @var FreshRSS_FeedDAO|null + */ private $feedDAO = null; /** @@ -345,7 +352,7 @@ class FeverAPI } /** - * @return int + * @return int|false */ protected function getTotalItems() { return $this->entryDAO->count(); @@ -502,11 +509,8 @@ class FeverAPI /** * TODO replace by a dynamic fetch for id <= $before timestamp - * - * @param int|string $beforeTimestamp - * @return string */ - protected function convertBeforeToId($beforeTimestamp): string { + protected function convertBeforeToId(string $beforeTimestamp): string { return $beforeTimestamp == '0' ? '0' : $beforeTimestamp . '000000'; } @@ -515,7 +519,7 @@ class FeverAPI */ protected function setFeedAsRead(string $id, string $before) { $before = $this->convertBeforeToId($before); - return $this->entryDAO->markReadFeed($id, $before); + return $this->entryDAO->markReadFeed(intval($id), $before); } /** @@ -529,7 +533,7 @@ class FeverAPI return $this->entryDAO->markReadEntries($before); } - return $this->entryDAO->markReadCat($id, $before); + return $this->entryDAO->markReadCat(intval($id), $before); } } -- cgit v1.2.3