aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/categoryController.php
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2023-03-21 18:57:57 +0100
committerGravatar GitHub <noreply@github.com> 2023-03-21 18:57:57 +0100
commit247215ffaa2966919115f283fb67a0096df8dc1c (patch)
tree16ff9d0ec502bd95f0a1e2d6b49f853cf963e804 /app/Controllers/categoryController.php
parente679d3df0e55530c056d701b4773ff7e74f5c82c (diff)
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 <sanchezluc+freshrss@gmail.com>
Diffstat (limited to 'app/Controllers/categoryController.php')
-rw-r--r--app/Controllers/categoryController.php18
1 files changed, 9 insertions, 9 deletions
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<string,int> */
- public static function refreshDynamicOpmls() {
+ public static function refreshDynamicOpmls(): array {
$successes = 0;
$errors = 0;
$catDAO = FreshRSS_Factory::createCategoryDao();