Skip to content
Extraits de code Groupes Projets
Valider b4fb9d3f rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Do not use static local variable in FrontController so tests can initialize...

Do not use static local variable in FrontController so tests can initialize the object in test methods.
parent d1c8d8cc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -65,6 +65,11 @@ class FrontController extends Singleton ...@@ -65,6 +65,11 @@ class FrontController extends Singleton
*/ */
public static $enableDispatch = true; public static $enableDispatch = true;
/**
* @var bool
*/
private $initialized = false;
/** /**
* Executes the requested plugin controller method. * Executes the requested plugin controller method.
* *
...@@ -197,11 +202,11 @@ class FrontController extends Singleton ...@@ -197,11 +202,11 @@ class FrontController extends Singleton
*/ */
public function init() public function init()
{ {
static $initialized = false; if ($this->initialized) {
if ($initialized) {
return; return;
} }
$initialized = true;
$this->initialized = true;
$tmpPath = StaticContainer::get('path.tmp'); $tmpPath = StaticContainer::get('path.tmp');
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter