1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/16955] Clean up code in db classes

PHPBB3-16955
This commit is contained in:
Marc Alexander
2022-12-27 14:13:23 +01:00
parent 3bc100c9a0
commit 948023078b
26 changed files with 277 additions and 327 deletions

View File

@@ -47,7 +47,7 @@ class config implements \phpbb\db\migration\tool\tool_interface
* @param mixed $config_value The value of the config setting
* @param bool $is_dynamic True if it is dynamic (changes very often)
* and should not be stored in the cache, false if not.
* @return null
* @return void
*/
public function add($config_name, $config_value, $is_dynamic = false)
{
@@ -65,7 +65,7 @@ class config implements \phpbb\db\migration\tool\tool_interface
* @param string $config_name The name of the config setting you would
* like to update
* @param mixed $config_value The value of the config setting
* @return null
* @return void
* @throws \phpbb\db\migration\exception
*/
public function update($config_name, $config_value)
@@ -87,7 +87,7 @@ class config implements \phpbb\db\migration\tool\tool_interface
* @param string $config_name The name of the config setting you would
* like to update
* @param mixed $config_value The value of the config setting
* @return null
* @return void
* @throws \phpbb\db\migration\exception
*/
public function update_if_equals($compare, $config_name, $config_value)
@@ -105,7 +105,7 @@ class config implements \phpbb\db\migration\tool\tool_interface
*
* @param string $config_name The name of the config setting you would
* like to remove
* @return null
* @return void
*/
public function remove($config_name)
{

View File

@@ -45,7 +45,7 @@ class config_text implements \phpbb\db\migration\tool\tool_interface
* @param string $config_name The name of the config_text setting
* you would like to add
* @param mixed $config_value The value of the config_text setting
* @return null
* @return void
*/
public function add($config_name, $config_value)
{
@@ -81,7 +81,7 @@ class config_text implements \phpbb\db\migration\tool\tool_interface
*
* @param string $config_name The name of the config_text setting you would
* like to remove
* @return null
* @return void
*/
public function remove($config_name)
{

View File

@@ -162,7 +162,7 @@ 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.
* path, specify that here
* @return null
* @return void
* @throws \phpbb\db\migration\exception
*/
public function add($class, $parent = 0, $data = array())

View File

@@ -21,7 +21,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface
/** @var \phpbb\auth\auth */
protected $auth;
/** @var \includes\acp\auth\auth_admin */
/** @var \auth_admin */
protected $auth_admin;
/** @var \phpbb\cache\service */
@@ -115,7 +115,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface
* @param bool $global True for checking a global permission setting,
* False for a local permission setting
* @param int|false $copy_from If set, contains the id of the permission from which to copy the new one.
* @return null
* @return void
*/
public function add($auth_option, $global = true, $copy_from = false)
{
@@ -189,7 +189,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface
* @param string $auth_option The name of the permission (auth) option
* @param bool $global True for checking a global permission setting,
* False for a local permission setting
* @return null
* @return void
*/
public function remove($auth_option, $global = true)
{
@@ -266,7 +266,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface
* @param string $role_type The type (u_, m_, a_)
* @param string $role_description Description of the new role
*
* @return null
* @return int|null Inserted SQL id or false if role already exists
*/
public function role_add($role_name, $role_type, $role_description = '')
{
@@ -292,7 +292,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface
$sql = 'INSERT INTO ' . ACL_ROLES_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
$this->db->sql_query($sql);
return $this->db->sql_nextid();
return (int) $this->db->sql_nextid();
}
/**
@@ -300,7 +300,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface
*
* @param string $old_role_name The old role name
* @param string $new_role_name The new role name
* @return null
* @return void
* @throws \phpbb\db\migration\exception
*/
public function role_update($old_role_name, $new_role_name)
@@ -320,7 +320,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface
* Remove a permission role
*
* @param string $role_name The role name to remove
* @return null
* @return void
*/
public function role_remove($role_name)
{
@@ -704,9 +704,6 @@ class permission implements \phpbb\db\migration\tool\tool_interface
break;
}
if ($call)
{
return call_user_func_array(array(&$this, $call), $arguments);
}
return $call ? call_user_func_array(array(&$this, $call), $arguments) : null;
}
}

View File

@@ -31,7 +31,7 @@ interface tool_interface
* First argument is the original call to the class (e.g. add, remove)
* After the first argument, send the original arguments to the function in the original call
*
* @return null
* @return mixed|null Return of function call or null if no valid function call found
*/
public function reverse();
}