From f5eb0d744e46a2931aa667dbc7a8a4d9ea0229e6 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 22 Sep 2013 21:17:30 +0200 Subject: [feature/passwords] Use dependency injection for helper This will now be used instead of manually loading the passwords helper instance in the passwords manager. PHPBB3-11610 --- phpBB/phpbb/passwords/manager.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/passwords/manager.php') diff --git a/phpBB/phpbb/passwords/manager.php b/phpBB/phpbb/passwords/manager.php index cf6eddd135..6cc3510f8e 100644 --- a/phpBB/phpbb/passwords/manager.php +++ b/phpBB/phpbb/passwords/manager.php @@ -60,15 +60,16 @@ class phpbb_passwords_manager * @param phpbb_config $config phpBB configuration * @param phpbb_di_service_collection $hashing_algorithms Hashing driver * service collection + * @param phpbb_passwords_helper $helper Passwords helper object * @param string $default Default driver name */ - public function __construct($config, $hashing_algorithms, $default) + public function __construct($config, $hashing_algorithms, $helper, $default) { $this->config = $config; $this->type = $default; $this->fill_type_map($hashing_algorithms); - $this->load_passwords_helper(); + $this->load_passwords_helper($helper); } /** @@ -94,12 +95,15 @@ class phpbb_passwords_manager /** * Load passwords helper class + * + * @param phpbb_passwords_helper $helper Passwords helper object */ - protected function load_passwords_helper() + protected function load_passwords_helper($helper) { if ($this->helper === null) { - $this->helper = new phpbb_passwords_helper($this); + $this->helper = $helper; + $this->helper->set_manager($this); } } -- cgit v1.2.1