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/DatabaseDAOPGSQL.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/DatabaseDAOPGSQL.php')
| -rw-r--r-- | app/Models/DatabaseDAOPGSQL.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/Models/DatabaseDAOPGSQL.php b/app/Models/DatabaseDAOPGSQL.php index fe3d6149d..e6895e6f1 100644 --- a/app/Models/DatabaseDAOPGSQL.php +++ b/app/Models/DatabaseDAOPGSQL.php @@ -10,6 +10,7 @@ class FreshRSS_DatabaseDAOPGSQL extends FreshRSS_DatabaseDAOSQLite { public const UNDEFINED_COLUMN = '42703'; public const UNDEFINED_TABLE = '42P01'; + #[\Override] public function tablesAreCorrect(): bool { $db = FreshRSS_Context::systemConf()->db; $sql = 'SELECT * FROM pg_catalog.pg_tables where tableowner=:tableowner'; @@ -34,6 +35,7 @@ class FreshRSS_DatabaseDAOPGSQL extends FreshRSS_DatabaseDAOSQLite { } /** @return array<array<string,string|int|bool|null>> */ + #[\Override] public function getSchema(string $table): array { $sql = <<<'SQL' SELECT column_name AS field, data_type AS type, column_default AS default, is_nullable AS null @@ -47,6 +49,7 @@ SQL; * @param array<string,string|int|bool|null> $dao * @return array{'name':string,'type':string,'notnull':bool,'default':mixed} */ + #[\Override] public function daoToSchema(array $dao): array { return [ 'name' => (string)($dao['field']), @@ -56,6 +59,7 @@ SQL; ]; } + #[\Override] public function size(bool $all = false): int { if ($all) { $db = FreshRSS_Context::systemConf()->db; @@ -75,7 +79,7 @@ SQL; return (int)($res[0] ?? -1); } - + #[\Override] public function optimize(): bool { $ok = true; $tables = ['category', 'feed', 'entry', 'entrytmp', 'tag', 'entrytag']; |
