4
0
Эх сурвалжийг харах

Minz remove use of deprecated variable (#6132)

and related improvements to clarify inheritance
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/6130
Alexandre Alapetite 2 жил өмнө
parent
commit
96484d22a1

+ 0 - 2
app/FreshRSS.php

@@ -23,8 +23,6 @@ class FreshRSS extends Minz_FrontController {
 			Minz_Session::init('FreshRSS');
 			Minz_Session::init('FreshRSS');
 		}
 		}
 
 
-		Minz_ActionController::$defaultViewType = FreshRSS_View::class;
-
 		FreshRSS_Context::initSystem();
 		FreshRSS_Context::initSystem();
 		if (!FreshRSS_Context::hasSystemConf()) {
 		if (!FreshRSS_Context::hasSystemConf()) {
 			$message = 'Error during context system init!';
 			$message = 'Error during context system init!';

+ 5 - 1
app/Models/ActionController.php

@@ -1,10 +1,14 @@
 <?php
 <?php
 declare(strict_types=1);
 declare(strict_types=1);
 
 
-class FreshRSS_ActionController extends Minz_ActionController {
+abstract class FreshRSS_ActionController extends Minz_ActionController {
 
 
 	/**
 	/**
 	 * @var FreshRSS_View
 	 * @var FreshRSS_View
 	 */
 	 */
 	protected $view;
 	protected $view;
+
+	public function __construct(string $viewType = '') {
+		parent::__construct($viewType === '' ? FreshRSS_View::class : $viewType);
+	}
 }
 }

+ 1 - 1
lib/Minz/ActionController.php

@@ -9,7 +9,7 @@ declare(strict_types=1);
 /**
 /**
  * The Minz_ActionController class is a controller in the MVC paradigm
  * The Minz_ActionController class is a controller in the MVC paradigm
  */
  */
-class Minz_ActionController {
+abstract class Minz_ActionController {
 
 
 	/** @var array<string,string> */
 	/** @var array<string,string> */
 	private static array $csp_default = [
 	private static array $csp_default = [

+ 1 - 1
lib/Minz/Dispatcher.php

@@ -10,7 +10,7 @@ declare(strict_types=1);
  * The Dispatcher is in charge of initialising the Controller and exectue the action as specified in the Request object.
  * The Dispatcher is in charge of initialising the Controller and exectue the action as specified in the Request object.
  * It is a singleton.
  * It is a singleton.
  */
  */
-class Minz_Dispatcher {
+final class Minz_Dispatcher {
 
 
 	/**
 	/**
 	 * Singleton
 	 * Singleton