diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-11 02:06:06 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-11 02:06:06 +0300 |
commit | d3e92fa484956fd1edf853cac83e7d2c7a0f3310 (patch) | |
tree | 7f206ac592f1c7503d7cd3b6c343c44662495b0a /core | |
parent | 43aeef9722aa6e33274688d3dd99b7091557dc93 (diff) |
Simplified use of DI in Menu classes by removing the parent constructor
Diffstat (limited to 'core')
-rw-r--r-- | core/Plugin/Menu.php | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/core/Plugin/Menu.php b/core/Plugin/Menu.php index d2c54645f1..a95ad71c9a 100644 --- a/core/Plugin/Menu.php +++ b/core/Plugin/Menu.php @@ -30,16 +30,6 @@ use Piwik\Plugins\UsersManager\UserPreferences; */ class Menu { - protected $module = ''; - - /** - * @ignore - */ - public function __construct() - { - $this->module = $this->getModule(); - } - private function getModule() { $className = get_class($this); @@ -69,7 +59,7 @@ class Menu { $params = (array) $additionalParams; $params['action'] = ''; - $params['module'] = $this->module; + $params['module'] = $this->getModule(); return $params; } @@ -88,11 +78,11 @@ class Menu */ protected function urlForAction($controllerAction, $additionalParams = array()) { - $this->checkisValidCallable($this->module, $controllerAction); + $this->checkisValidCallable($this->getModule(), $controllerAction); $params = (array) $additionalParams; $params['action'] = $controllerAction; - $params['module'] = $this->module; + $params['module'] = $this->getModule(); return $params; } |