@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * Tries to create a new group. If the group name already exists, false will |
| 80 | 80 | * be returned. |
| 81 | 81 | */ |
| 82 | - public function createGroup( $gid ) { |
|
| 82 | + public function createGroup($gid) { |
|
| 83 | 83 | $this->fixDI(); |
| 84 | 84 | |
| 85 | 85 | // Add group |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * |
| 101 | 101 | * Deletes a group and removes it from the group_user-table |
| 102 | 102 | */ |
| 103 | - public function deleteGroup( $gid ) { |
|
| 103 | + public function deleteGroup($gid) { |
|
| 104 | 104 | $this->fixDI(); |
| 105 | 105 | |
| 106 | 106 | // Delete the group |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * |
| 136 | 136 | * Checks whether the user is member of a group or not. |
| 137 | 137 | */ |
| 138 | - public function inGroup( $uid, $gid ) { |
|
| 138 | + public function inGroup($uid, $gid) { |
|
| 139 | 139 | $this->fixDI(); |
| 140 | 140 | |
| 141 | 141 | // check |
@@ -160,18 +160,18 @@ discard block |
||
| 160 | 160 | * |
| 161 | 161 | * Adds a user to a group. |
| 162 | 162 | */ |
| 163 | - public function addToGroup( $uid, $gid ) { |
|
| 163 | + public function addToGroup($uid, $gid) { |
|
| 164 | 164 | $this->fixDI(); |
| 165 | 165 | |
| 166 | 166 | // No duplicate entries! |
| 167 | - if( !$this->inGroup( $uid, $gid )) { |
|
| 167 | + if (!$this->inGroup($uid, $gid)) { |
|
| 168 | 168 | $qb = $this->dbConn->getQueryBuilder(); |
| 169 | 169 | $qb->insert('group_user') |
| 170 | 170 | ->setValue('uid', $qb->createNamedParameter($uid)) |
| 171 | 171 | ->setValue('gid', $qb->createNamedParameter($gid)) |
| 172 | 172 | ->execute(); |
| 173 | 173 | return true; |
| 174 | - }else{ |
|
| 174 | + } else { |
|
| 175 | 175 | return false; |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * |
| 185 | 185 | * removes the user from a group. |
| 186 | 186 | */ |
| 187 | - public function removeFromGroup( $uid, $gid ) { |
|
| 187 | + public function removeFromGroup($uid, $gid) { |
|
| 188 | 188 | $this->fixDI(); |
| 189 | 189 | |
| 190 | 190 | $qb = $this->dbConn->getQueryBuilder(); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * This function fetches all groups a user belongs to. It does not check |
| 205 | 205 | * if the user exists at all. |
| 206 | 206 | */ |
| 207 | - public function getUserGroups( $uid ) { |
|
| 207 | + public function getUserGroups($uid) { |
|
| 208 | 208 | //guests has empty or null $uid |
| 209 | 209 | if ($uid === null || $uid === '') { |
| 210 | 210 | return []; |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | ->execute(); |
| 221 | 221 | |
| 222 | 222 | $groups = []; |
| 223 | - while( $row = $cursor->fetch()) { |
|
| 223 | + while ($row = $cursor->fetch()) { |
|
| 224 | 224 | $groups[] = $row['gid']; |
| 225 | 225 | $this->groupCache[$row['gid']] = $row['gid']; |
| 226 | 226 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | if ($search !== '') { |
| 248 | 248 | $query->where($query->expr()->iLike('gid', $query->createNamedParameter( |
| 249 | - '%' . $this->dbConn->escapeLikeParameter($search) . '%' |
|
| 249 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
| 250 | 250 | ))); |
| 251 | 251 | } |
| 252 | 252 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | if ($search !== '') { |
| 310 | 310 | $query->andWhere($query->expr()->like('uid', $query->createNamedParameter( |
| 311 | - '%' . $this->dbConn->escapeLikeParameter($search) . '%' |
|
| 311 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
| 312 | 312 | ))); |
| 313 | 313 | } |
| 314 | 314 | |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | if ($search !== '') { |
| 342 | 342 | $query->andWhere($query->expr()->like('uid', $query->createNamedParameter( |
| 343 | - '%' . $this->dbConn->escapeLikeParameter($search) . '%' |
|
| 343 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
| 344 | 344 | ))); |
| 345 | 345 | } |
| 346 | 346 | |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | $result->closeCursor(); |
| 350 | 350 | |
| 351 | 351 | if ($count !== false) { |
| 352 | - $count = (int)$count; |
|
| 352 | + $count = (int) $count; |
|
| 353 | 353 | } |
| 354 | 354 | return $count; |
| 355 | 355 | } |