@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $result = $builder->insert('groups') |
| 105 | 105 | ->setValue('gid', $builder->createNamedParameter($gid)) |
| 106 | 106 | ->execute(); |
| 107 | - } catch(UniqueConstraintViolationException $e) { |
|
| 107 | + } catch (UniqueConstraintViolationException $e) { |
|
| 108 | 108 | $result = 0; |
| 109 | 109 | } |
| 110 | 110 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * |
| 157 | 157 | * Checks whether the user is member of a group or not. |
| 158 | 158 | */ |
| 159 | - public function inGroup( $uid, $gid ) { |
|
| 159 | + public function inGroup($uid, $gid) { |
|
| 160 | 160 | $this->fixDI(); |
| 161 | 161 | |
| 162 | 162 | // check |
@@ -185,14 +185,14 @@ discard block |
||
| 185 | 185 | $this->fixDI(); |
| 186 | 186 | |
| 187 | 187 | // No duplicate entries! |
| 188 | - if( !$this->inGroup( $uid, $gid )) { |
|
| 188 | + if (!$this->inGroup($uid, $gid)) { |
|
| 189 | 189 | $qb = $this->dbConn->getQueryBuilder(); |
| 190 | 190 | $qb->insert('group_user') |
| 191 | 191 | ->setValue('uid', $qb->createNamedParameter($uid)) |
| 192 | 192 | ->setValue('gid', $qb->createNamedParameter($gid)) |
| 193 | 193 | ->execute(); |
| 194 | 194 | return true; |
| 195 | - }else{ |
|
| 195 | + } else { |
|
| 196 | 196 | return false; |
| 197 | 197 | } |
| 198 | 198 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * This function fetches all groups a user belongs to. It does not check |
| 226 | 226 | * if the user exists at all. |
| 227 | 227 | */ |
| 228 | - public function getUserGroups( $uid ) { |
|
| 228 | + public function getUserGroups($uid) { |
|
| 229 | 229 | //guests has empty or null $uid |
| 230 | 230 | if ($uid === null || $uid === '') { |
| 231 | 231 | return []; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | ->execute(); |
| 242 | 242 | |
| 243 | 243 | $groups = []; |
| 244 | - while( $row = $cursor->fetch()) { |
|
| 244 | + while ($row = $cursor->fetch()) { |
|
| 245 | 245 | $groups[] = $row['gid']; |
| 246 | 246 | $this->groupCache[$row['gid']] = $row['gid']; |
| 247 | 247 | } |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | |
| 270 | 270 | if ($search !== '') { |
| 271 | 271 | $query->where($query->expr()->iLike('gid', $query->createNamedParameter( |
| 272 | - '%' . $this->dbConn->escapeLikeParameter($search) . '%' |
|
| 272 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
| 273 | 273 | ))); |
| 274 | 274 | } |
| 275 | 275 | |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | if ($search !== '') { |
| 335 | 335 | $query->andWhere($query->expr()->like('uid', $query->createNamedParameter( |
| 336 | - '%' . $this->dbConn->escapeLikeParameter($search) . '%' |
|
| 336 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
| 337 | 337 | ))); |
| 338 | 338 | } |
| 339 | 339 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | |
| 367 | 367 | if ($search !== '') { |
| 368 | 368 | $query->andWhere($query->expr()->like('uid', $query->createNamedParameter( |
| 369 | - '%' . $this->dbConn->escapeLikeParameter($search) . '%' |
|
| 369 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
| 370 | 370 | ))); |
| 371 | 371 | } |
| 372 | 372 | |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | $result->closeCursor(); |
| 376 | 376 | |
| 377 | 377 | if ($count !== false) { |
| 378 | - $count = (int)$count; |
|
| 378 | + $count = (int) $count; |
|
| 379 | 379 | } else { |
| 380 | 380 | $count = 0; |
| 381 | 381 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | $this->fixDI(); |
| 394 | 394 | |
| 395 | 395 | $query = $this->dbConn->getQueryBuilder(); |
| 396 | - $query->select($query->createFunction('COUNT(DISTINCT ' . $query->getColumnName('uid') . ')')) |
|
| 396 | + $query->select($query->createFunction('COUNT(DISTINCT '.$query->getColumnName('uid').')')) |
|
| 397 | 397 | ->from('preferences', 'p') |
| 398 | 398 | ->innerJoin('p', 'group_user', 'g', $query->expr()->eq('p.userid', 'g.uid')) |
| 399 | 399 | ->where($query->expr()->eq('appid', $query->createNamedParameter('core'))) |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | $result->closeCursor(); |
| 407 | 407 | |
| 408 | 408 | if ($count !== false) { |
| 409 | - $count = (int)$count; |
|
| 409 | + $count = (int) $count; |
|
| 410 | 410 | } else { |
| 411 | 411 | $count = 0; |
| 412 | 412 | } |