summaryrefslogtreecommitdiff
path: root/app/Models/StatsDAOSQLite.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 /app/Models/StatsDAOSQLite.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 'app/Models/StatsDAOSQLite.php')
-rw-r--r--app/Models/StatsDAOSQLite.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/Models/StatsDAOSQLite.php b/app/Models/StatsDAOSQLite.php
index 9f292aae6..7d5be10c0 100644
--- a/app/Models/StatsDAOSQLite.php
+++ b/app/Models/StatsDAOSQLite.php
@@ -24,11 +24,10 @@ GROUP BY period
ORDER BY period ASC
SQL;
- $stm = $this->pdo->query($sql);
- if ($stm === false) {
+ $res = $this->fetchAssoc($sql);
+ if ($res == null) {
return [];
}
- $res = $stm->fetchAll(PDO::FETCH_NAMED);
switch ($period) {
case '%H':
@@ -46,7 +45,7 @@ SQL;
$repartition = array_fill(0, $periodMax, 0);
foreach ($res as $value) {
- $repartition[(int) $value['period']] = (int) $value['count'];
+ $repartition[(int)$value['period']] = (int)$value['count'];
}
return $repartition;