diff options
| author | 2021-12-31 17:00:51 +0100 | |
|---|---|---|
| committer | 2021-12-31 17:00:51 +0100 | |
| commit | 77e9877316fcfacb26799afdf32d94c8411da80e (patch) | |
| tree | 7fd9c85bf4854054be6536c14d120bc8b790debe /app/Models/UserDAO.php | |
| parent | 09c84fb3bc44bf8e45619c27acc15b967aea14ce (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/UserDAO.php')
| -rw-r--r-- | app/Models/UserDAO.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php index 1596fa5cc..c9a3436d8 100644 --- a/app/Models/UserDAO.php +++ b/app/Models/UserDAO.php @@ -5,9 +5,10 @@ class FreshRSS_UserDAO extends Minz_ModelPdo { require(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php'); try { - $sql = $SQL_CREATE_TABLES . $SQL_CREATE_TABLE_ENTRYTMP . $SQL_CREATE_TABLE_TAGS; + $sql = $GLOBALS['$SQL_CREATE_TABLES'] . $GLOBALS['SQL_CREATE_TABLE_ENTRYTMP'] . $GLOBALS['SQL_CREATE_TABLE_TAGS']; $ok = $this->pdo->exec($sql) !== false; //Note: Only exec() can take multiple statements safely. } catch (Exception $e) { + $ok = false; Minz_Log::error('Error while creating database for user ' . $this->current_user . ': ' . $e->getMessage()); } @@ -26,7 +27,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo { } require(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php'); - $ok = $this->pdo->exec($SQL_DROP_TABLES) !== false; + $ok = $this->pdo->exec($GLOBALS['SQL_DROP_TABLES']) !== false; if ($ok) { return true; |
