From 89b0ff1da8bd6869c8afed8493ff33895cd31bde Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 13 Mar 2014 16:09:32 -0700 Subject: [PATCH 1/4] [ticket/12263] Fix incorrect docblock commets PHPBB3-12263 --- phpBB/phpbb/db/migration/tool/module.php | 4 ++-- phpBB/phpbb/db/migration/tool/permission.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 3e39d87c04..6f2b6cc75a 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -19,7 +19,7 @@ class module implements \phpbb\db\migration\tool\tool_interface /** @var \phpbb\cache\service */ protected $cache; - /** @var dbal */ + /** @var \phpbb\db\driver\driver */ protected $db; /** @var \phpbb\user */ @@ -38,7 +38,7 @@ class module implements \phpbb\db\migration\tool\tool_interface * Constructor * * @param \phpbb\db\driver\driver $db - * @param mixed $cache + * @param \phpbb\cache\service * @param \phpbb\user $user * @param string $phpbb_root_path * @param string $php_ext diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index fd2de9c8fb..7fe5e05302 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -22,7 +22,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface /** @var \phpbb\cache\service */ protected $cache; - /** @var dbal */ + /** @var \phpbb\db\driver\driver */ protected $db; /** @var string */ @@ -35,7 +35,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface * Constructor * * @param \phpbb\db\driver\driver $db - * @param mixed $cache + * @param \phpbb\cache\service * @param \phpbb\auth\auth $auth * @param string $phpbb_root_path * @param string $php_ext From 5df3e0a4ec4a30434f7b727149d1e60c3223cb42 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 13 Mar 2014 16:10:08 -0700 Subject: [PATCH 2/4] [ticket/12263] Remove unused argument in module add/remove PHPBB3-12263 --- phpBB/phpbb/db/migration/tool/module.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 6f2b6cc75a..3baddd857a 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -163,11 +163,10 @@ class module implements \phpbb\db\migration\tool\tool_interface * ) * Optionally you may not send 'modes' and it will insert all of the * modules in that info file. - * @param string|bool $include_path If you would like to use a custom include * path, specify that here * @return null */ - public function add($class, $parent = 0, $data = array(), $include_path = false) + public function add($class, $parent = 0, $data = array()) { // Allows '' to be sent as 0 $parent = $parent ?: 0; @@ -328,11 +327,10 @@ class module implements \phpbb\db\migration\tool\tool_interface * @param int|string|bool $parent The parent module_id|module_langname(0 for no parent). * Use false to ignore the parent check and check class wide. * @param int|string $module The module id|module_langname - * @param string|bool $include_path If you would like to use a custom include path, * specify that here * @return null */ - public function remove($class, $parent = 0, $module = '', $include_path = false) + public function remove($class, $parent = 0, $module = '') { // Imitation of module_add's "automatic" and "manual" method so the uninstaller works from the same set of instructions for umil_auto if (is_array($module)) @@ -340,7 +338,7 @@ class module implements \phpbb\db\migration\tool\tool_interface if (isset($module['module_langname'])) { // Manual Method - return $this->remove($class, $parent, $module['module_langname'], $include_path); + return $this->remove($class, $parent, $module['module_langname']); } // Failed. From c48fe65dfdb507973b58e8c0750664fefe61b095 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 13 Mar 2014 16:20:38 -0700 Subject: [PATCH 3/4] [ticket/12263] Remove invalid SQL query and unused variables PHPBB3-12263 --- phpBB/phpbb/db/migration/tool/module.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 3baddd857a..b2c14cfddb 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -405,22 +405,10 @@ class module implements \phpbb\db\migration\tool\tool_interface $module_ids[] = (int) $module_id; } $this->db->sql_freeresult($result); - - $module_name = $module; } else { - $module = (int) $module; - $sql = 'SELECT module_langname - FROM ' . $this->modules_table . " - WHERE module_id = $module - AND module_class = '" . $this->db->sql_escape($class) . "' - $parent_sql"; - $result = $this->db->sql_query($sql); - $module_name = $this->db->sql_fetchfield('module_id'); - $this->db->sql_freeresult($result); - - $module_ids[] = $module; + $module_ids[] = (int) $module; } if (!class_exists('acp_modules')) From 08165881f29a304a901d5fd84d2c62a4c127fabb Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 13 Mar 2014 16:38:10 -0700 Subject: [PATCH 4/4] [ticket/12263] Add missing variable names to docblock fixes PHPBB3-12263 --- phpBB/phpbb/db/migration/tool/module.php | 2 +- phpBB/phpbb/db/migration/tool/permission.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index b2c14cfddb..ebbcbae301 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -38,7 +38,7 @@ class module implements \phpbb\db\migration\tool\tool_interface * Constructor * * @param \phpbb\db\driver\driver $db - * @param \phpbb\cache\service + * @param \phpbb\cache\service $cache * @param \phpbb\user $user * @param string $phpbb_root_path * @param string $php_ext diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index 7fe5e05302..38fcbd2952 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -35,7 +35,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface * Constructor * * @param \phpbb\db\driver\driver $db - * @param \phpbb\cache\service + * @param \phpbb\cache\service $cache * @param \phpbb\auth\auth $auth * @param string $phpbb_root_path * @param string $php_ext