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/FreshRSS.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'app/FreshRSS.php') diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 54caef3bc..64b8d13ae 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -24,6 +24,8 @@ class FreshRSS extends Minz_FrontController { Minz_Session::init('FreshRSS'); } + Minz_ActionController::$viewType = 'FreshRSS_View'; + FreshRSS_Context::initSystem(); if (FreshRSS_Context::$system_conf == null) { $message = 'Error during context system init!'; @@ -105,7 +107,7 @@ class FreshRSS extends Minz_FrontController { case '.js': $theme_id = $theme['id']; $filename = $file; - Minz_View::prependScript(Minz_Url::display(FreshRSS::getThemeFileUrl($theme_id, $filename))); + FreshRSS_View::prependScript(Minz_Url::display(FreshRSS::getThemeFileUrl($theme_id, $filename))); break; case '.css': default: @@ -120,21 +122,21 @@ class FreshRSS extends Minz_FrontController { $filename = substr($filename, 0, -4); $filename = $filename . '.rtl.css'; } - Minz_View::prependStyle(Minz_Url::display(FreshRSS::getThemeFileUrl($theme_id, $filename))); + FreshRSS_View::prependStyle(Minz_Url::display(FreshRSS::getThemeFileUrl($theme_id, $filename))); } } } //Use prepend to insert before extensions. Added in reverse order. if (Minz_Request::controllerName() !== 'index') { - Minz_View::prependScript(Minz_Url::display('/scripts/extra.js?' . @filemtime(PUBLIC_PATH . '/scripts/extra.js'))); + FreshRSS_View::prependScript(Minz_Url::display('/scripts/extra.js?' . @filemtime(PUBLIC_PATH . '/scripts/extra.js'))); } - Minz_View::prependScript(Minz_Url::display('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js'))); + FreshRSS_View::prependScript(Minz_Url::display('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js'))); } private static function loadNotifications() { $notif = Minz_Request::getNotification(); if ($notif) { - Minz_View::_param('notification', $notif); + FreshRSS_View::_param('notification', $notif); } } -- cgit v1.2.3