From 288ed04ccc30b58373576dc3be811aee43e67034 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 31 Mar 2023 08:23:39 +0200 Subject: PHPStan level 6 for all PDO and Exception classes (#5239) * PHPStan level 6 for all PDO and Exception classes Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112 * Fix type * Now also our remaining own librairies * Motivation for a few more files * A few more DAO classes * Last interface --- app/Models/DatabaseDAOPGSQL.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/Models/DatabaseDAOPGSQL.php') diff --git a/app/Models/DatabaseDAOPGSQL.php b/app/Models/DatabaseDAOPGSQL.php index 6ff706250..b1db0f347 100644 --- a/app/Models/DatabaseDAOPGSQL.php +++ b/app/Models/DatabaseDAOPGSQL.php @@ -33,6 +33,7 @@ class FreshRSS_DatabaseDAOPGSQL extends FreshRSS_DatabaseDAOSQLite { return count(array_keys($tables, true, true)) == count($tables); } + /** @return array> */ public function getSchema(string $table): array { $sql = 'select column_name as field, data_type as type, column_default as default, is_nullable as null from INFORMATION_SCHEMA.COLUMNS where table_name = ?'; $stm = $this->pdo->prepare($sql); @@ -40,6 +41,10 @@ class FreshRSS_DatabaseDAOPGSQL extends FreshRSS_DatabaseDAOSQLite { return $this->listDaoToSchema($stm->fetchAll(PDO::FETCH_ASSOC)); } + /** + * @param array $dao + * @return array + */ public function daoToSchema(array $dao): array { return array( 'name' => $dao['field'], -- cgit v1.2.3