From 77e9877316fcfacb26799afdf32d94c8411da80e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 31 Dec 2021 17:00:51 +0100 Subject: Add PHPStan (#4021) * Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug --- app/Controllers/updateController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/Controllers/updateController.php') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 862fb0cf9..16ab7e427 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -108,7 +108,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { } public function indexAction() { - Minz_View::prependTitle(_t('admin.update.title') . ' · '); + FreshRSS_View::prependTitle(_t('admin.update.title') . ' · '); if (file_exists(UPDATE_FILENAME)) { // There is an update file to apply! @@ -224,6 +224,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { $res = !self::hasGitUpdate(); } else { require(UPDATE_FILENAME); + // @phpstan-ignore-next-line $res = do_post_update(); } @@ -244,9 +245,12 @@ class FreshRSS_update_Controller extends Minz_ActionController { } else { require(UPDATE_FILENAME); if (Minz_Request::isPost()) { + // @phpstan-ignore-next-line save_info_update(); } + // @phpstan-ignore-next-line if (!need_info_update()) { + // @phpstan-ignore-next-line $res = apply_update(); } else { return; @@ -269,7 +273,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { * This action displays information about installation. */ public function checkInstallAction() { - Minz_View::prependTitle(_t('admin.check_install.title') . ' · '); + FreshRSS_View::prependTitle(_t('admin.check_install.title') . ' · '); $this->view->status_php = check_install_php(); $this->view->status_files = check_install_files(); -- cgit v1.2.3