diff options
| author | 2023-04-28 14:01:11 +0200 | |
|---|---|---|
| committer | 2023-04-28 14:01:11 +0200 | |
| commit | c72914bba2363e436574204b3d6093a6f3cfce89 (patch) | |
| tree | 377008a7393e4d80e4c8659f27dd42c0ccbab382 /app/Controllers/categoryController.php | |
| parent | 26e2a703125ffe1d0d2746b0e5ea3491b627832c (diff) | |
PHPStan Level 7 for more DAO PDO (#5328)
* PHPStan Level 7 for more DAO PDO
With new function to address common type and check problems
* A bit more
* PHPStan Level 7 for FreshRSS_Entry
Diffstat (limited to 'app/Controllers/categoryController.php')
| -rw-r--r-- | app/Controllers/categoryController.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php index 0ca1bbbcd..60685c566 100644 --- a/app/Controllers/categoryController.php +++ b/app/Controllers/categoryController.php @@ -79,6 +79,8 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { /** * This action updates the given category. + * @todo Check whether this function is used at all + * @see FreshRSS_subscription_Controller::categoryAction() (consider merging) * * Request parameters are: * - id @@ -97,14 +99,16 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { Minz_Request::bad(_t('feedback.sub.category.no_name'), $url_redirect); } - if ($catDAO->searchById($id) == null) { + $cat = $catDAO->searchById($id); + if ($cat === null) { Minz_Request::bad(_t('feedback.sub.category.not_exist'), $url_redirect); } - $cat = new FreshRSS_Category($name); - $values = array( + $values = [ 'name' => $cat->name(), - ); + 'kind' => $cat->kind(), + 'attributes' => $cat->attributes(), + ]; if ($catDAO->updateCategory($id, $values)) { Minz_Request::good(_t('feedback.sub.category.updated'), $url_redirect); |
