From 350edf398c55b472e19a3017de9b4d2d3420b9e4 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 10 Apr 2024 15:33:43 +0200 Subject: 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 --- app/Models/DatabaseDAOPGSQL.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/Models/DatabaseDAOPGSQL.php') 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> */ + #[\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 $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']; -- cgit v1.2.3