mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-20 03:07:56 -05:00
* PHP 8.3 #[\Override] https://php.watch/versions/8.3/override-attr With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute And modified the call to phpstan-next on the model of https://github.com/FreshRSS/Extensions/pull/228 (more robust than the find method, which gave some strange errors) * Update extension example accordingly
21 lines
539 B
PHP
21 lines
539 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')")) {
|
|
$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;
|
|
}
|
|
|
|
}
|