diff options
| author | 2023-03-31 08:23:39 +0200 | |
|---|---|---|
| committer | 2023-03-31 08:23:39 +0200 | |
| commit | 288ed04ccc30b58373576dc3be811aee43e67034 (patch) | |
| tree | 27f4c571e04d64c97737416dfa2b8d65f481dfd8 /app/Controllers | |
| parent | c9d5fe2da12cbc3a071ebf9a518afe2789bb3d61 (diff) | |
PHPStan level 6 for all PDO and Exception classes (#5239)
* PHPStan level 6 for all PDO and Exception classes
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
* Fix type
* Now also our remaining own librairies
* Motivation for a few more files
* A few more DAO classes
* Last interface
Diffstat (limited to 'app/Controllers')
| -rw-r--r-- | app/Controllers/feedController.php | 5 | ||||
| -rw-r--r-- | app/Controllers/tagController.php | 3 | ||||
| -rw-r--r-- | app/Controllers/userController.php | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 2fcc5eda6..0e98d1e16 100644 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -47,10 +47,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { $url = trim($url); /** @var string|null $url */ - $url = Minz_ExtensionManager::callHook('check_url_before_add', $url); - if (null === $url) { + $urlHooked = Minz_ExtensionManager::callHook('check_url_before_add', $url); + if ($urlHooked === $url) { throw new FreshRSS_FeedNotAdded_Exception($url); } + $url = $urlHooked; $cat = null; if ($cat_id > 0) { diff --git a/app/Controllers/tagController.php b/app/Controllers/tagController.php index b8db23f3e..69844f7bc 100644 --- a/app/Controllers/tagController.php +++ b/app/Controllers/tagController.php @@ -126,7 +126,8 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController { $sourceId = Minz_Request::param('id_tag'); if ($targetName == '' || $sourceId == '') { - return Minz_Error::error(400); + Minz_Error::error(400); + return; } $tagDAO = FreshRSS_Factory::createTagDao(); diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 89489e590..f49406b13 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -431,11 +431,13 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { } elseif (FreshRSS_Auth::hasAccess()) { $user_config = FreshRSS_Context::$user_conf; } else { - return Minz_Error::error(403); + Minz_Error::error(403); + return; } if (!FreshRSS_UserDAO::exists($username) || $user_config === null) { - return Minz_Error::error(404); + Minz_Error::error(404); + return; } if ($user_config->email_validation_token === '') { |
