From dfac9f5813df7d4c7c812c381364c8898333f559 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 11 Sep 2024 17:14:53 +0200 Subject: PHPStan booleansInConditions (#6793) * PHPStan booleansInConditions * Uniformisation --- app/Models/DatabaseDAOSQLite.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Models/DatabaseDAOSQLite.php') diff --git a/app/Models/DatabaseDAOSQLite.php b/app/Models/DatabaseDAOSQLite.php index 9380df094..231616f49 100644 --- a/app/Models/DatabaseDAOSQLite.php +++ b/app/Models/DatabaseDAOSQLite.php @@ -10,7 +10,7 @@ class FreshRSS_DatabaseDAOSQLite extends FreshRSS_DatabaseDAO { public function tablesAreCorrect(): bool { $sql = "SELECT name FROM sqlite_master WHERE type='table'"; $stm = $this->pdo->query($sql); - $res = $stm ? $stm->fetchAll(PDO::FETCH_ASSOC) : false; + $res = $stm !== false ? $stm->fetchAll(PDO::FETCH_ASSOC) : false; if ($res === false) { return false; } @@ -35,7 +35,7 @@ class FreshRSS_DatabaseDAOSQLite extends FreshRSS_DatabaseDAO { public function getSchema(string $table): array { $sql = 'PRAGMA table_info(' . $table . ')'; $stm = $this->pdo->query($sql); - return $stm ? $this->listDaoToSchema($stm->fetchAll(PDO::FETCH_ASSOC) ?: []) : []; + return $stm !== false ? $this->listDaoToSchema($stm->fetchAll(PDO::FETCH_ASSOC) ?: []) : []; } #[\Override] -- cgit v1.2.3