aboutsummaryrefslogtreecommitdiff
path: root/app/Models/DatabaseDAOPGSQL.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/DatabaseDAOPGSQL.php')
-rw-r--r--app/Models/DatabaseDAOPGSQL.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/Models/DatabaseDAOPGSQL.php b/app/Models/DatabaseDAOPGSQL.php
index 3cce4b062..a183bdee6 100644
--- a/app/Models/DatabaseDAOPGSQL.php
+++ b/app/Models/DatabaseDAOPGSQL.php
@@ -34,7 +34,7 @@ class FreshRSS_DatabaseDAOPGSQL extends FreshRSS_DatabaseDAOSQLite {
return count(array_keys($tables, true, true)) === count($tables);
}
- /** @return array<array{name:string,type:string,notnull:bool,default:mixed}> */
+ /** @return list<array{name:string,type:string,notnull:bool,default:mixed}> */
#[\Override]
public function getSchema(string $table): array {
$sql = <<<'SQL'
@@ -52,10 +52,10 @@ SQL;
#[\Override]
public function daoToSchema(array $dao): array {
return [
- 'name' => (string)($dao['field']),
- 'type' => strtolower((string)($dao['type'])),
- 'notnull' => (bool)$dao['null'],
- 'default' => $dao['default'],
+ 'name' => is_string($dao['field'] ?? null) ? $dao['field'] : '',
+ 'type' => is_string($dao['type'] ?? null) ? strtolower($dao['type']) : '',
+ 'notnull' => empty($dao['null']),
+ 'default' => is_scalar($dao['default'] ?? null) ? $dao['default'] : null,
];
}