1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-28 10:40:28 +02:00

[ticket/13713] Add type hints and clean up code

PHPBB3-13713
This commit is contained in:
Marc Alexander
2021-05-04 21:23:21 +02:00
parent 794b77971c
commit ed291843f2
10 changed files with 102 additions and 79 deletions

View File

@@ -18,22 +18,21 @@ class usergroup extends base_group
/**
* {@inheritdoc}
*/
protected function query($keyword, $topic_id)
protected function query(string $keyword, int $topic_id): string
{
$query = $this->db->sql_build_query('SELECT', [
'SELECT' => 'g.group_id',
'FROM' => [
return $this->db->sql_build_query('SELECT', [
'SELECT' => 'g.group_id',
'FROM' => [
GROUPS_TABLE => 'g',
],
'LEFT_JOIN' => [
[
'FROM' => [USER_GROUP_TABLE => 'ug'],
'ON' => 'g.group_id = ug.group_id'
'FROM' => [USER_GROUP_TABLE => 'ug'],
'ON' => 'g.group_id = ug.group_id'
]
],
'WHERE' => 'ug.user_pending = 0 AND ug.user_id = ' . (int) $this->user->data['user_id'],
'WHERE' => 'ug.user_pending = 0 AND ug.user_id = ' . (int) $this->user->data['user_id'],
'ORDER_BY' => 'g.group_name',
]);
return $query;
}
}