aboutsummaryrefslogtreecommitdiff
path: root/p/api/fever.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-04-28 14:01:11 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-28 14:01:11 +0200
commitc72914bba2363e436574204b3d6093a6f3cfce89 (patch)
tree377008a7393e4d80e4c8659f27dd42c0ccbab382 /p/api/fever.php
parent26e2a703125ffe1d0d2746b0e5ea3491b627832c (diff)
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
Diffstat (limited to 'p/api/fever.php')
-rw-r--r--p/api/fever.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/p/api/fever.php b/p/api/fever.php
index 26efe841b..fde4ba7f5 100644
--- a/p/api/fever.php
+++ b/p/api/fever.php
@@ -113,7 +113,7 @@ final class FeverDAO extends Minz_ModelPdo
$sql .= ' LIMIT 50';
$stm = $this->pdo->prepare($sql);
- if ($stm && $stm->execute($values)) {
+ if ($stm !== false && $stm->execute($values)) {
$result = $stm->fetchAll(PDO::FETCH_ASSOC);
$entries = array();
@@ -374,10 +374,7 @@ final class FeverAPI
return $favicons;
}
- /**
- * @return int|false
- */
- private function getTotalItems() {
+ private function getTotalItems(): int {
return $this->entryDAO->count();
}
@@ -419,12 +416,12 @@ final class FeverAPI
}
private function getUnreadItemIds(): string {
- $entries = $this->entryDAO->listIdsWhere('a', 0, FreshRSS_Entry::STATE_NOT_READ, 'ASC', 0) ?: [];
+ $entries = $this->entryDAO->listIdsWhere('a', 0, FreshRSS_Entry::STATE_NOT_READ, 'ASC', 0) ?? [];
return $this->entriesToIdList($entries);
}
private function getSavedItemIds(): string {
- $entries = $this->entryDAO->listIdsWhere('a', 0, FreshRSS_Entry::STATE_FAVORITE, 'ASC', 0) ?: [];
+ $entries = $this->entryDAO->listIdsWhere('a', 0, FreshRSS_Entry::STATE_FAVORITE, 'ASC', 0) ?? [];
return $this->entriesToIdList($entries);
}