From 247215ffaa2966919115f283fb67a0096df8dc1c Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Tue, 21 Mar 2023 18:57:57 +0100 Subject: Typehint some Controllers (#5106) * Typehint to Controllers * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex --------- Co-authored-by: Luc --- app/Controllers/categoryController.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'app/Controllers/categoryController.php') diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php index 335c0c970..e9bf59654 100644 --- a/app/Controllers/categoryController.php +++ b/app/Controllers/categoryController.php @@ -11,7 +11,7 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { * underlying framework. * */ - public function firstAction() { + public function firstAction(): void { if (!FreshRSS_Auth::hasAccess()) { Minz_Error::error(403); } @@ -26,7 +26,7 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { * Request parameter is: * - new-category */ - public function createAction() { + public function createAction() :void { $catDAO = FreshRSS_Factory::createCategoryDao(); $tagDAO = FreshRSS_Factory::createTagDao(); @@ -84,7 +84,7 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { * - id * - name */ - public function updateAction() { + public function updateAction(): void { $catDAO = FreshRSS_Factory::createCategoryDao(); $url_redirect = array('c' => 'subscription', 'a' => 'index'); @@ -124,7 +124,7 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { * Request parameter is: * - id (of a category) */ - public function deleteAction() { + public function deleteAction(): void { $feedDAO = FreshRSS_Factory::createFeedDao(); $catDAO = FreshRSS_Factory::createCategoryDao(); $url_redirect = array('c' => 'subscription', 'a' => 'index'); @@ -168,7 +168,7 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { * - id (of a category) * - muted (truthy to remove only muted feeds, or falsy otherwise) */ - public function emptyAction() { + public function emptyAction(): void { $feedDAO = FreshRSS_Factory::createFeedDao(); $url_redirect = array('c' => 'subscription', 'a' => 'index'); @@ -182,7 +182,7 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { $muted = Minz_Request::param('muted', null); if ($muted !== null) { - $muted = boolval($muted); + $muted = (bool)$muted; } // List feeds to remove then related user queries. @@ -211,7 +211,7 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { * Request parameter is: * - id (of a category) */ - public function refreshOpmlAction() { + public function refreshOpmlAction(): void { $catDAO = FreshRSS_Factory::createCategoryDao(); $url_redirect = array('c' => 'subscription', 'a' => 'index'); @@ -224,7 +224,7 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { } $category = $catDAO->searchById($id); - if ($category == null) { + if ($category === null) { Minz_Request::bad(_t('feedback.sub.category.not_exist'), $url_redirect); } @@ -247,7 +247,7 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { } /** @return array */ - public static function refreshDynamicOpmls() { + public static function refreshDynamicOpmls(): array { $successes = 0; $errors = 0; $catDAO = FreshRSS_Factory::createCategoryDao(); -- cgit v1.2.3