Files
FreshRSS/app/Models/CategoryDAOSQLite.php
Alexandre Alapetite 288ed04ccc PHPStan level 6 for all PDO and Exception classes (#5239)
* PHPStan level 6 for all PDO and Exception classes
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112

* Fix type

* Now also our remaining own librairies

* Motivation for a few more files

* A few more DAO classes

* Last interface
2023-03-31 08:23:39 +02:00

19 lines
490 B
PHP

<?php
class FreshRSS_CategoryDAOSQLite extends FreshRSS_CategoryDAO {
/** @param array<string> $errorInfo */
protected function autoUpdateDb(array $errorInfo): bool {
if ($tableInfo = $this->pdo->query("PRAGMA table_info('category')")) {
$columns = $tableInfo->fetchAll(PDO::FETCH_COLUMN, 1);
foreach (['kind', 'lastUpdate', 'error', 'attributes'] as $column) {
if (!in_array($column, $columns)) {
return $this->addColumn($column);
}
}
}
return false;
}
}