diff options
| author | 2021-12-02 23:30:13 +0100 | |
|---|---|---|
| committer | 2021-12-02 23:30:13 +0100 | |
| commit | 00dbde68fbaf7da68ccf191c33f2de88d3603aa8 (patch) | |
| tree | 26b182e58df9adc8ff0210bda5bb4b03d28571a1 | |
| parent | a2ab9cf83aaead96497a70a1430ce0424c0d8316 (diff) | |
Fix some PHPstan errors (#4019)
Fix some wrong variables found by https://github.com/FreshRSS/FreshRSS/issues/4016
| -rw-r--r-- | app/Models/FeedDAO.php | 2 | ||||
| -rw-r--r-- | app/Models/Tag.php | 2 | ||||
| -rw-r--r-- | app/Models/UserDAO.php | 6 | ||||
| -rw-r--r-- | p/ext.php | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 0d65e171d..150bbe921 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -460,7 +460,7 @@ SQL; . 'SET `cache_nbUnreads`=`cache_nbUnreads`-' . $affected . ' WHERE id=:id'; $stm = $this->pdo->prepare($sql); - $stm->bindParam(':id', $id_feed, PDO::PARAM_INT); + $stm->bindParam(':id', $id, PDO::PARAM_INT); if (!($stm && $stm->execute())) { $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); Minz_Log::error('SQL error keepMaxUnread cache: ' . json_encode($info)); diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 0d50e356c..199e03b85 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -55,7 +55,7 @@ class FreshRSS_Tag extends Minz_Model { $tagDAO = FreshRSS_Factory::createTagDao(); $this->nbEntries = $tagDAO->countEntries($this->id()); } - return $this->nbFeed; + return $this->nbEntries; } public function _nbEntries($value) { diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php index 266c8bc0e..1596fa5cc 100644 --- a/app/Models/UserDAO.php +++ b/app/Models/UserDAO.php @@ -14,7 +14,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo { if ($ok) { return true; } else { - $info = empty($stm) ? $this->pdo->errorInfo() : $stm->errorInfo(); + $info = $this->pdo->errorInfo(); Minz_Log::error(__METHOD__ . ' error: ' . json_encode($info)); return false; } @@ -31,8 +31,8 @@ class FreshRSS_UserDAO extends Minz_ModelPdo { if ($ok) { return true; } else { - $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); - Minz_Log::error(__METHOD__ . ' error: ' . $info[2]); + $info = $this->pdo->errorInfo(); + Minz_Log::error(__METHOD__ . ' error: ' . json_encode($info)); return false; } } @@ -80,7 +80,7 @@ function is_valid_path_extension($path, $extensionPath, $isStatic = true) { */ function is_valid_path($path) { return is_valid_path_extension($path, CORE_EXTENSIONS_PATH) || is_valid_path_extension($path, THIRDPARTY_EXTENSIONS_PATH) - || is_valid_path_extension($path, USERS_PATH, $false); + || is_valid_path_extension($path, USERS_PATH, false); } function sendBadRequestResponse(string $message = null) { |
