Files
FreshRSS/app/Models/CategoryDAOSQLite.php
Alexandre Alapetite dfac9f5813 PHPStan booleansInConditions (#6793)
* PHPStan booleansInConditions

* Uniformisation
2024-09-11 17:14:53 +02:00

20 lines
550 B
PHP

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