aboutsummaryrefslogtreecommitdiff
path: root/app/Models/CategoryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-11-18 23:21:20 +0100
committerGravatar GitHub <noreply@github.com> 2023-11-18 23:21:20 +0100
commitb65ea979010eb488cc9c1fb1d0f082e868c191d5 (patch)
treebe2c1b06aa5fcea8d33d43ba76acbfff3e4f0f0e /app/Models/CategoryDAO.php
parent445e49db15ea7ae41dc55efea2d67903557f9182 (diff)
Fix PHP 7 compatibility strict_types (#5893)
* Fix PHP 7 compatibility https://github.com/FreshRSS/FreshRSS/discussions/5892 * Multiple PHP 7 fixes * PHPStan
Diffstat (limited to 'app/Models/CategoryDAO.php')
-rw-r--r--app/Models/CategoryDAO.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index 5dfecb36d..2477d0ea2 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -435,6 +435,8 @@ SQL;
$feedsDao = [];
$feedDao = FreshRSS_Factory::createFeedDao();
foreach ($listDAO as $line) {
+ FreshRSS_DatabaseDAO::pdoInt($line, ['c_id', 'c_kind', 'c_last_update', 'c_error',
+ 'id', 'kind', 'priority', 'error', 'cache_nbEntries', 'cache_nbUnreads', 'ttl']);
if (!empty($previousLine['c_id']) && $line['c_id'] !== $previousLine['c_id']) {
// End of the current category, we add it to the $list
$cat = new FreshRSS_Category(
@@ -444,7 +446,7 @@ SQL;
$cat->_id($previousLine['c_id']);
$cat->_kind($previousLine['c_kind']);
$cat->_attributes('', $previousLine['c_attributes'] ?? '[]');
- $list[$previousLine['c_id']] = $cat;
+ $list[(int)$previousLine['c_id']] = $cat;
$feedsDao = []; //Prepare for next category
}
@@ -464,7 +466,7 @@ SQL;
$cat->_lastUpdate($previousLine['c_last_update'] ?? 0);
$cat->_error($previousLine['c_error'] ?? 0);
$cat->_attributes('', $previousLine['c_attributes'] ?? []);
- $list[$previousLine['c_id']] = $cat;
+ $list[(int)$previousLine['c_id']] = $cat;
}
return $list;
@@ -478,6 +480,7 @@ SQL;
$list = [];
foreach ($listDAO as $dao) {
+ FreshRSS_DatabaseDAO::pdoInt($dao, ['id', 'kind', 'lastUpdate', 'error']);
$cat = new FreshRSS_Category(
$dao['name']
);