1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 17:27:16 +02:00

[ticket/9687] Fix code style and tests

PHPBB3-9687
This commit is contained in:
Oliver Schramm
2018-10-01 23:40:15 +02:00
committed by Marc Alexander
parent 64ab1fc24c
commit e7015bf1dd
17 changed files with 78 additions and 55 deletions

View File

@@ -749,7 +749,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
$db->sql_query($sql);
// Delete the user_id from the banlist
$sql = 'DELETE FROM ' . BAN_TABLE . '
$sql = 'DELETE FROM ' . BANS_TABLE . '
WHERE ban_mode = \'user\' AND ' . $db->sql_in_set('ban_item', $user_ids);
$db->sql_query($sql);

View File

@@ -15,7 +15,6 @@ namespace phpbb\ban;
use phpbb\ban\exception\ban_insert_failed_exception;
use phpbb\ban\exception\invalid_length_exception;
use phpbb\ban\exception\no_items_specified_exception;
use phpbb\ban\exception\type_not_found_exception;
class manager
@@ -189,7 +188,7 @@ class manager
$user_ids = [];
while ($row = $this->db->sql_fetchrow($result))
{
$user_ids[] = (int)$row['user_id'];
$user_ids[] = (int) $row['user_id'];
}
$this->db->sql_freeresult($result);
}

View File

@@ -95,7 +95,7 @@ abstract class base implements type_interface
}
$this->excluded = [
(int)$this->user->data['user_id'] => $this->user->data[$user_column],
(int) $this->user->data['user_id'] => $this->user->data[$user_column],
];
$sql = "SELECT user_id, {$user_column}

View File

@@ -14,7 +14,6 @@
namespace phpbb\ban\type;
use phpbb\ban\exception\no_valid_emails_exception;
use phpbb\ban\exception\no_valid_users_exception;
use phpbb\exception\runtime_exception;
class email extends base

View File

@@ -13,8 +13,6 @@
namespace phpbb\ban\type;
use phpbb\mimetype\null_guesser;
/**
* Interface implemented by all ban types
*/

View File

@@ -148,7 +148,7 @@ class ban_table_p1 extends \phpbb\db\migration\migration
$processed_rows++;
$bans[] = [
'ban_userid' => ($row['ban_mode'] === 'user') ? (int)$row['ban_item'] : 0,
'ban_userid' => ($row['ban_mode'] === 'user') ? (int) $row['ban_item'] : 0,
'ban_ip' => ($row['ban_mode'] === 'ip') ? $row['ban_item'] : '',
'ban_email' => ($row['ban_mode'] === 'email') ? $row['ban_item'] : '',
'ban_start' => $row['ban_start'],

View File

@@ -35,7 +35,7 @@ class ban_table_p2 extends \phpbb\db\migration\migration
'add_tables' => array(
$this->table_prefix . 'banlist' => array(
'COLUMNS' => array(
'ban_id' => array('ULINT', NULL, 'auto_increment'),
'ban_id' => array('ULINT', null, 'auto_increment'),
'ban_userid' => array('ULINT', 0),
'ban_ip' => array('VCHAR:40', ''),
'ban_email' => array('VCHAR_UNI:100', ''),