Passed
Push — master ( d682fe...3a99ef )
by Roeland
10:22
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
 	}
@@ -271,9 +271,9 @@  discard block
 block discarded – undo
271 271
 				$query->expr()->eq('configkey', $query->expr()->literal('email')))
272 272
 			)
273 273
 			// sqlite doesn't like re-using a single named parameter here
274
-			->where($query->expr()->iLike('uid', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
275
-			->orWhere($query->expr()->iLike('displayname', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
276
-			->orWhere($query->expr()->iLike('configvalue', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
274
+			->where($query->expr()->iLike('uid', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
275
+			->orWhere($query->expr()->iLike('displayname', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
276
+			->orWhere($query->expr()->iLike('configvalue', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
277 277
 			->orderBy($query->func()->lower('displayname'), 'ASC')
278 278
 			->orderBy('uid_lower', 'ASC')
279 279
 			->setMaxResults($limit)
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 		$result = $query->execute();
283 283
 		$displayNames = [];
284 284
 		while ($row = $result->fetch()) {
285
-			$displayNames[(string)$row['uid']] = (string)$row['displayname'];
285
+			$displayNames[(string) $row['uid']] = (string) $row['displayname'];
286 286
 		}
287 287
 
288 288
 		return $displayNames;
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 				if (!empty($newHash)) {
321 321
 					$this->updatePassword($uid, $newHash);
322 322
 				}
323
-				return (string)$row['uid'];
323
+				return (string) $row['uid'];
324 324
 			}
325 325
 
326 326
 		}
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 	private function loadUser($uid) {
338 338
 		$this->fixDI();
339 339
 
340
-		$uid = (string)$uid;
340
+		$uid = (string) $uid;
341 341
 		if (!isset($this->cache[$uid])) {
342 342
 			//guests $uid could be NULL or ''
343 343
 			if ($uid === '') {
@@ -361,8 +361,8 @@  discard block
 block discarded – undo
361 361
 
362 362
 			// "uid" is primary key, so there can only be a single result
363 363
 			if ($row !== false) {
364
-				$this->cache[$uid]['uid'] = (string)$row['uid'];
365
-				$this->cache[$uid]['displayname'] = (string)$row['displayname'];
364
+				$this->cache[$uid]['uid'] = (string) $row['uid'];
365
+				$this->cache[$uid]['displayname'] = (string) $row['displayname'];
366 366
 			} else {
367 367
 				return false;
368 368
 			}
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
 	 */
382 382
 	public function getUsers($search = '', $limit = null, $offset = null) {
383 383
 		$users = $this->getDisplayNames($search, $limit, $offset);
384
-		$userIds = array_map(function ($uid) {
385
-			return (string)$uid;
384
+		$userIds = array_map(function($uid) {
385
+			return (string) $uid;
386 386
 		}, array_keys($users));
387 387
 		sort($userIds, SORT_STRING | SORT_FLAG_CASE);
388 388
 		return $userIds;
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 	 */
408 408
 	public function getHome(string $uid) {
409 409
 		if ($this->userExists($uid)) {
410
-			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid;
410
+			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$uid;
411 411
 		}
412 412
 
413 413
 		return false;
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 
480 480
 	public function getRealUID(string $uid): string {
481 481
 		if (!$this->userExists($uid)) {
482
-			throw new \RuntimeException($uid . ' does not exist');
482
+			throw new \RuntimeException($uid.' does not exist');
483 483
 		}
484 484
 
485 485
 		return $this->cache[$uid]['uid'];
Please login to merge, or discard this patch.