aboutsummaryrefslogtreecommitdiff
path: root/p/api/fever.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-02-07 00:56:45 +0100
committerGravatar GitHub <noreply@github.com> 2022-02-07 00:56:45 +0100
commit7c2da31418d3479b60c9c6b28cc595deda93d434 (patch)
treec8f0f3481e9a32aea5243f74cf86313ef57f9ec1 /p/api/fever.php
parentdfee46792f91cc357f697f35e7429c0c196f6a16 (diff)
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
Diffstat (limited to 'p/api/fever.php')
-rw-r--r--p/api/fever.php18
1 files changed, 11 insertions, 7 deletions
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);
}
}