Passed
Push — master ( 5bc2a6...18bafe )
by Joas
14:06 queued 11s
created
lib/private/User/Database.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	 * @return string display name
240 240
 	 */
241 241
 	public function getDisplayName($uid): string {
242
-		$uid = (string)$uid;
242
+		$uid = (string) $uid;
243 243
 		$this->loadUser($uid);
244 244
 		return empty($this->cache[$uid]['displayname']) ? $uid : $this->cache[$uid]['displayname'];
245 245
 	}
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
 				$query->expr()->eq('configkey', $query->expr()->literal('email')))
268 268
 			)
269 269
 			// sqlite doesn't like re-using a single named parameter here
270
-			->where($query->expr()->iLike('uid', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
271
-			->orWhere($query->expr()->iLike('displayname', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
272
-			->orWhere($query->expr()->iLike('configvalue', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
270
+			->where($query->expr()->iLike('uid', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
271
+			->orWhere($query->expr()->iLike('displayname', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
272
+			->orWhere($query->expr()->iLike('configvalue', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
273 273
 			->orderBy($query->func()->lower('displayname'), 'ASC')
274 274
 			->addOrderBy('uid_lower', 'ASC')
275 275
 			->setMaxResults($limit)
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 		$result = $query->execute();
279 279
 		$displayNames = [];
280 280
 		while ($row = $result->fetch()) {
281
-			$displayNames[(string)$row['uid']] = (string)$row['displayname'];
281
+			$displayNames[(string) $row['uid']] = (string) $row['displayname'];
282 282
 		}
283 283
 
284 284
 		return $displayNames;
@@ -307,8 +307,8 @@  discard block
 block discarded – undo
307 307
 			))
308 308
 			->where($query->expr()->eq('k.known_to', $query->createNamedParameter($searcher)))
309 309
 			->andWhere($query->expr()->orX(
310
-				$query->expr()->iLike('u.uid', $query->createNamedParameter('%' . $this->dbConn->escapeLikeParameter($pattern) . '%')),
311
-				$query->expr()->iLike('u.displayname', $query->createNamedParameter('%' . $this->dbConn->escapeLikeParameter($pattern) . '%'))
310
+				$query->expr()->iLike('u.uid', $query->createNamedParameter('%'.$this->dbConn->escapeLikeParameter($pattern).'%')),
311
+				$query->expr()->iLike('u.displayname', $query->createNamedParameter('%'.$this->dbConn->escapeLikeParameter($pattern).'%'))
312 312
 			))
313 313
 			->orderBy('u.displayname', 'ASC')
314 314
 			->addOrderBy('u.uid_lower', 'ASC')
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 		$result = $query->execute();
319 319
 		$displayNames = [];
320 320
 		while ($row = $result->fetch()) {
321
-			$displayNames[(string)$row['uid']] = (string)$row['displayname'];
321
+			$displayNames[(string) $row['uid']] = (string) $row['displayname'];
322 322
 		}
323 323
 
324 324
 		return $displayNames;
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 				if (!empty($newHash)) {
345 345
 					$this->updatePassword($loginName, $newHash);
346 346
 				}
347
-				return (string)$this->cache[$loginName]['uid'];
347
+				return (string) $this->cache[$loginName]['uid'];
348 348
 			}
349 349
 		}
350 350
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	private function loadUser($uid) {
361 361
 		$this->fixDI();
362 362
 
363
-		$uid = (string)$uid;
363
+		$uid = (string) $uid;
364 364
 		if (!isset($this->cache[$uid])) {
365 365
 			//guests $uid could be NULL or ''
366 366
 			if ($uid === '') {
@@ -383,9 +383,9 @@  discard block
 block discarded – undo
383 383
 			// "uid" is primary key, so there can only be a single result
384 384
 			if ($row !== false) {
385 385
 				$this->cache[$uid] = [
386
-					'uid' => (string)$row['uid'],
387
-					'displayname' => (string)$row['displayname'],
388
-					'password' => (string)$row['password'],
386
+					'uid' => (string) $row['uid'],
387
+					'displayname' => (string) $row['displayname'],
388
+					'password' => (string) $row['password'],
389 389
 				];
390 390
 			} else {
391 391
 				$this->cache[$uid] = false;
@@ -408,8 +408,8 @@  discard block
 block discarded – undo
408 408
 		$limit = $this->fixLimit($limit);
409 409
 
410 410
 		$users = $this->getDisplayNames($search, $limit, $offset);
411
-		$userIds = array_map(function ($uid) {
412
-			return (string)$uid;
411
+		$userIds = array_map(function($uid) {
412
+			return (string) $uid;
413 413
 		}, array_keys($users));
414 414
 		sort($userIds, SORT_STRING | SORT_FLAG_CASE);
415 415
 		return $userIds;
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 */
435 435
 	public function getHome(string $uid) {
436 436
 		if ($this->userExists($uid)) {
437
-			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid;
437
+			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$uid;
438 438
 		}
439 439
 
440 440
 		return false;
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 
507 507
 	public function getRealUID(string $uid): string {
508 508
 		if (!$this->userExists($uid)) {
509
-			throw new \RuntimeException($uid . ' does not exist');
509
+			throw new \RuntimeException($uid.' does not exist');
510 510
 		}
511 511
 
512 512
 		return $this->cache[$uid]['uid'];
Please login to merge, or discard this patch.