summaryrefslogtreecommitdiff
path: root/app/Models/DatabaseDAOPGSQL.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-03-31 08:23:39 +0200
committerGravatar GitHub <noreply@github.com> 2023-03-31 08:23:39 +0200
commit288ed04ccc30b58373576dc3be811aee43e67034 (patch)
tree27f4c571e04d64c97737416dfa2b8d65f481dfd8 /app/Models/DatabaseDAOPGSQL.php
parentc9d5fe2da12cbc3a071ebf9a518afe2789bb3d61 (diff)
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
Diffstat (limited to 'app/Models/DatabaseDAOPGSQL.php')
-rw-r--r--app/Models/DatabaseDAOPGSQL.php5
1 files changed, 5 insertions, 0 deletions
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<array<string,string|bool>> */
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<string,string> $dao
+ * @return array<string,string|bool>
+ */
public function daoToSchema(array $dao): array {
return array(
'name' => $dao['field'],