aboutsummaryrefslogtreecommitdiff
path: root/app/Models/DatabaseDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2021-12-31 17:00:51 +0100
committerGravatar GitHub <noreply@github.com> 2021-12-31 17:00:51 +0100
commit77e9877316fcfacb26799afdf32d94c8411da80e (patch)
tree7fd9c85bf4854054be6536c14d120bc8b790debe /app/Models/DatabaseDAO.php
parent09c84fb3bc44bf8e45619c27acc15b967aea14ce (diff)
Add PHPStan (#4021)
* Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug
Diffstat (limited to 'app/Models/DatabaseDAO.php')
-rw-r--r--app/Models/DatabaseDAO.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php
index 86f72b14c..b1ce0cca6 100644
--- a/app/Models/DatabaseDAO.php
+++ b/app/Models/DatabaseDAO.php
@@ -24,7 +24,7 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
$db = FreshRSS_Context::$system_conf->db;
try {
- $sql = sprintf($SQL_CREATE_DB, empty($db['base']) ? '' : $db['base']);
+ $sql = sprintf($GLOBALS['SQL_CREATE_DB'], empty($db['base']) ? '' : $db['base']);
return $this->pdo->exec($sql) === false ? 'Error during CREATE DATABASE' : '';
} catch (Exception $e) {
syslog(LOG_DEBUG, __method__ . ' notice: ' . $e->getMessage());
@@ -176,7 +176,7 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
$ok = false;
try {
- $ok = $this->pdo->exec($SQL_UPDATE_GUID_LATIN1_BIN) !== false; //FreshRSS 1.12
+ $ok = $this->pdo->exec($GLOBALS['SQL_UPDATE_GUID_LATIN1_BIN']) !== false; //FreshRSS 1.12
} catch (Exception $e) {
$ok = false;
Minz_Log::error(__METHOD__ . ' error: ' . $e->getMessage());
@@ -277,6 +277,8 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
$entryFrom = $entryDAOSQLite; $entryTo = $entryDAO;
$tagFrom = $tagDAOSQLite; $tagTo = $tagDAO;
break;
+ default:
+ return;
}
$idMaps = [];