diff options
| author | 2024-04-10 15:33:43 +0200 | |
|---|---|---|
| committer | 2024-04-10 15:33:43 +0200 | |
| commit | 350edf398c55b472e19a3017de9b4d2d3420b9e4 (patch) | |
| tree | 00672f4cba0830e4b39f778e3a36de6b961fc5bb /app/Models/EntryDAOSQLite.php | |
| parent | 8280e3d88edb93211fcf2aec15a7b4c1ae4d3813 (diff) | |
PHP 8.3 #[\Override] (#6273)
* 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
Diffstat (limited to 'app/Models/EntryDAOSQLite.php')
| -rw-r--r-- | app/Models/EntryDAOSQLite.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php index 1a87d03be..91894b8ac 100644 --- a/app/Models/EntryDAOSQLite.php +++ b/app/Models/EntryDAOSQLite.php @@ -3,27 +3,33 @@ declare(strict_types=1); class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO { + #[\Override] public static function isCompressed(): bool { return false; } + #[\Override] public static function hasNativeHex(): bool { return false; } + #[\Override] protected static function sqlConcat(string $s1, string $s2): string { return $s1 . '||' . $s2; } + #[\Override] public static function sqlHexDecode(string $x): string { return $x; } + #[\Override] public static function sqlIgnoreConflict(string $sql): string { return str_replace('INSERT INTO ', 'INSERT OR IGNORE INTO ', $sql); } /** @param array<string|int> $errorInfo */ + #[\Override] protected function autoUpdateDb(array $errorInfo): bool { if ($tableInfo = $this->pdo->query("PRAGMA table_info('entry')")) { $columns = $tableInfo->fetchAll(PDO::FETCH_COLUMN, 1) ?: []; @@ -36,6 +42,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO { return false; } + #[\Override] public function commitNewEntries(): bool { $sql = <<<'SQL' DROP TABLE IF EXISTS `tmp`; @@ -74,6 +81,7 @@ SQL; * @param bool $is_read * @return int|false affected rows */ + #[\Override] public function markRead($ids, bool $is_read = true) { FreshRSS_UserDAO::touch(); if (is_array($ids)) { //Many IDs at once (used by API) @@ -119,6 +127,7 @@ SQL; * @param string $idMax max article ID * @return int|false affected rows */ + #[\Override] public function markReadTag($id = 0, string $idMax = '0', ?FreshRSS_BooleanSearch $filters = null, int $state = 0, bool $is_read = true) { FreshRSS_UserDAO::touch(); if ($idMax == 0) { |
