aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-06-04 14:00:33 +0200
committerGravatar GitHub <noreply@github.com> 2025-06-04 14:00:33 +0200
commit4de7d0b81310c788365fd3d2ab28dfbbccb5b171 (patch)
tree9e1217892a1f6a3ee33611ff739aa46cfb6bd825 /app/Models/EntryDAO.php
parent2b94cffeab0dfd66fcef15b6295efba24319b555 (diff)
PHPStan: pass checkImplicitMixed (#7642)
* PHPStan: pass checkImplicitMixed * Complete
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index af859045d..68746c380 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -43,7 +43,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
protected static function sqlRegex(string $expression, string $regex, array &$values): string {
// The implementation of this function is solely for MySQL and MariaDB
static $databaseDAOMySQL = null;
- if ($databaseDAOMySQL === null) {
+ if (!($databaseDAOMySQL instanceof FreshRSS_DatabaseDAO)) {
$databaseDAOMySQL = new FreshRSS_DatabaseDAO();
}
@@ -205,6 +205,8 @@ SQL;
return true;
} else {
$info = $this->addEntryPrepared == false ? $this->pdo->errorInfo() : $this->addEntryPrepared->errorInfo();
+ /** @var array{id:string,guid:string,title:string,author:string,content:string,link:string,date:int,lastSeen:int,hash:string,
+ * is_read:bool|int|null,is_favorite:bool|int|null,id_feed:int,tags:string,attributes?:null|string|array<string,mixed>} $valuesTmp */
/** @var array{0:string,1:int,2:string} $info */
if ($this->autoUpdateDb($info)) {
$this->addEntryPrepared = null;
@@ -315,6 +317,8 @@ SQL;
return true;
} else {
$info = $this->updateEntryPrepared == false ? $this->pdo->errorInfo() : $this->updateEntryPrepared->errorInfo();
+ /** @var array{id:string,guid:string,title:string,author:string,content:string,link:string,date:int,lastSeen:int,hash:string,
+ * is_read:bool|int|null,is_favorite:bool|int|null,id_feed:int,tags:string,attributes:array<string,mixed>} $valuesTmp */
/** @var array{0:string,1:int,2:string} $info */
if ($this->autoUpdateDb($info)) {
return $this->updateEntry($valuesTmp);
@@ -1461,7 +1465,9 @@ SQL;
[$values, $sql] = $this->sqlListWhere($type, $id, $state, $filters, id_min: $id_min, id_max: $id_max, order: $order,
continuation_id: $continuation_id, continuation_value: $continuation_value, limit: $limit, offset: $offset);
$stm = $this->pdo->prepare($sql);
- if ($stm !== false && $stm->execute($values) && ($res = $stm->fetchAll(PDO::FETCH_COLUMN, 0)) !== false) {
+ if ($stm !== false && $stm->execute($values)) {
+ /** @var list<int|numeric-string> $res */
+ $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0);
$res = array_map('strval', $res);
/** @var list<numeric-string> $res */
return $res;
@@ -1496,6 +1502,7 @@ SQL;
if ($stm !== false && $stm->execute($values)) {
$rows = $stm->fetchAll(PDO::FETCH_ASSOC);
foreach ($rows as $row) {
+ /** @var array{guid:string,hex_hash:string} $row */
$result[$row['guid']] = $row['hex_hash'];
}
return $result;