Passed
Push — master ( 70500e...f76321 )
by Roeland
20:36 queued 10:46
created
lib/private/User/Database.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 * @return string display name
246 246
 	 */
247 247
 	public function getDisplayName($uid): string {
248
-		$uid = (string)$uid;
248
+		$uid = (string) $uid;
249 249
 		$this->loadUser($uid);
250 250
 		return empty($this->cache[$uid]['displayname']) ? $uid : $this->cache[$uid]['displayname'];
251 251
 	}
@@ -273,9 +273,9 @@  discard block
 block discarded – undo
273 273
 				$query->expr()->eq('configkey', $query->expr()->literal('email')))
274 274
 			)
275 275
 			// sqlite doesn't like re-using a single named parameter here
276
-			->where($query->expr()->iLike('uid', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
277
-			->orWhere($query->expr()->iLike('displayname', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
278
-			->orWhere($query->expr()->iLike('configvalue', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
276
+			->where($query->expr()->iLike('uid', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
277
+			->orWhere($query->expr()->iLike('displayname', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
278
+			->orWhere($query->expr()->iLike('configvalue', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
279 279
 			->orderBy($query->func()->lower('displayname'), 'ASC')
280 280
 			->orderBy('uid_lower', 'ASC')
281 281
 			->setMaxResults($limit)
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 		$result = $query->execute();
285 285
 		$displayNames = [];
286 286
 		while ($row = $result->fetch()) {
287
-			$displayNames[(string)$row['uid']] = (string)$row['displayname'];
287
+			$displayNames[(string) $row['uid']] = (string) $row['displayname'];
288 288
 		}
289 289
 
290 290
 		return $displayNames;
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 				if (!empty($newHash)) {
323 323
 					$this->updatePassword($uid, $newHash);
324 324
 				}
325
-				return (string)$row['uid'];
325
+				return (string) $row['uid'];
326 326
 			}
327 327
 
328 328
 		}
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 	private function loadUser($uid) {
340 340
 		$this->fixDI();
341 341
 
342
-		$uid = (string)$uid;
342
+		$uid = (string) $uid;
343 343
 		if (!isset($this->cache[$uid])) {
344 344
 			//guests $uid could be NULL or ''
345 345
 			if ($uid === '') {
@@ -363,8 +363,8 @@  discard block
 block discarded – undo
363 363
 
364 364
 			// "uid" is primary key, so there can only be a single result
365 365
 			if ($row !== false) {
366
-				$this->cache[$uid]['uid'] = (string)$row['uid'];
367
-				$this->cache[$uid]['displayname'] = (string)$row['displayname'];
366
+				$this->cache[$uid]['uid'] = (string) $row['uid'];
367
+				$this->cache[$uid]['displayname'] = (string) $row['displayname'];
368 368
 			} else {
369 369
 				return false;
370 370
 			}
@@ -385,8 +385,8 @@  discard block
 block discarded – undo
385 385
 		$limit = $this->fixLimit($limit);
386 386
 
387 387
 		$users = $this->getDisplayNames($search, $limit, $offset);
388
-		$userIds = array_map(function ($uid) {
389
-			return (string)$uid;
388
+		$userIds = array_map(function($uid) {
389
+			return (string) $uid;
390 390
 		}, array_keys($users));
391 391
 		sort($userIds, SORT_STRING | SORT_FLAG_CASE);
392 392
 		return $userIds;
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 	 */
412 412
 	public function getHome(string $uid) {
413 413
 		if ($this->userExists($uid)) {
414
-			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid;
414
+			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$uid;
415 415
 		}
416 416
 
417 417
 		return false;
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 
484 484
 	public function getRealUID(string $uid): string {
485 485
 		if (!$this->userExists($uid)) {
486
-			throw new \RuntimeException($uid . ' does not exist');
486
+			throw new \RuntimeException($uid.' does not exist');
487 487
 		}
488 488
 
489 489
 		return $this->cache[$uid]['uid'];
Please login to merge, or discard this patch.