aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2023-04-07 12:32:10 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-07 12:32:10 +0200
commitd23d10bcde1a9b86c784d58b891f61e740e0124e (patch)
tree6f907e5d13a04832b3350286b1b847fbb3842ee7 /app/Controllers
parent6c01e4e7d6c177ac345c826059e585bffdd1d517 (diff)
Phpstan Level6 for View.php (#5269)
* Remarque's from Alkarex * indentation * indentation * Apply suggestions from code review Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Remarque's from Alkarex * A few improvements * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Fixes and improvments * Fix getTagsForEntry --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Controllers')
-rw-r--r--app/Controllers/authController.php2
-rw-r--r--app/Controllers/entryController.php6
-rw-r--r--app/Controllers/subscriptionController.php2
-rw-r--r--app/Controllers/tagController.php4
-rw-r--r--app/Controllers/userController.php3
5 files changed, 9 insertions, 8 deletions
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php
index e499f0b8a..fa5cb0d53 100644
--- a/app/Controllers/authController.php
+++ b/app/Controllers/authController.php
@@ -111,7 +111,7 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
FreshRSS_View::appendScript(Minz_Url::display('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js')));
$limits = FreshRSS_Context::$system_conf->limits;
- $this->view->cookie_days = round($limits['cookie_duration'] / 86400, 1);
+ $this->view->cookie_days = (int)round($limits['cookie_duration'] / 86400, 1);
$isPOST = Minz_Request::isPost() && !Minz_Session::param('POST_to_GET');
Minz_Session::_param('POST_to_GET');
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index 9faf20331..7a30f94de 100644
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -59,8 +59,8 @@ class FreshRSS_entry_Controller extends FreshRSS_ActionController {
FreshRSS_Context::$state = 0;
}
- $params = array();
- $this->view->tags = array();
+ $params = [];
+ $this->view->tagsForEntries = [];
$entryDAO = FreshRSS_Factory::createEntryDao();
if ($id == false) {
@@ -112,7 +112,7 @@ class FreshRSS_entry_Controller extends FreshRSS_ActionController {
foreach ($tagsForEntries as $line) {
$tags['t_' . $line['id_tag']][] = $line['id_entry'];
}
- $this->view->tags = $tags;
+ $this->view->tagsForEntries = $tags;
}
if (!$this->ajax) {
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php
index 70614708b..ff88aee9d 100644
--- a/app/Controllers/subscriptionController.php
+++ b/app/Controllers/subscriptionController.php
@@ -48,7 +48,7 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController {
FreshRSS_View::appendScript(Minz_Url::display('/scripts/feed.js?' . @filemtime(PUBLIC_PATH . '/scripts/feed.js')));
FreshRSS_View::prependTitle(_t('sub.title') . ' ยท ');
- $this->view->onlyFeedsWithError = Minz_Request::paramTernary('error');
+ $this->view->onlyFeedsWithError = Minz_Request::paramBoolean('error');
$id = Minz_Request::paramInt('id');
$this->view->displaySlider = false;
diff --git a/app/Controllers/tagController.php b/app/Controllers/tagController.php
index 86ff53cfa..e4048238c 100644
--- a/app/Controllers/tagController.php
+++ b/app/Controllers/tagController.php
@@ -85,9 +85,9 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController {
$this->view->_layout(false);
header('Content-Type: application/json; charset=UTF-8');
header('Cache-Control: private, no-cache, no-store, must-revalidate');
- $id_entry = Minz_Request::paramInt('id_entry');
+ $id_entry = Minz_Request::paramString('id_entry');
$tagDAO = FreshRSS_Factory::createTagDao();
- $this->view->tags = $tagDAO->getTagsForEntry($id_entry);
+ $this->view->tagsForEntry = $tagDAO->getTagsForEntry($id_entry);
}
public function addAction(): void {
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index 3777a7b4f..6d8d510db 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -629,7 +629,8 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController {
$this->view->details = $this->retrieveUserDetails($username);
}
- private function retrieveUserDetails($username) {
+ /** @return array<string,int|string|bool> */
+ private function retrieveUserDetails($username): array {
$feedDAO = FreshRSS_Factory::createFeedDao($username);
$entryDAO = FreshRSS_Factory::createEntryDao($username);
$databaseDAO = FreshRSS_Factory::createDatabaseDAO($username);