Completed
Pull Request — master (#9868)
by Robin
57:18 queued 28:47
created
lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,38 +41,38 @@
 block discarded – undo
41 41
 	}
42 42
 
43 43
 	public function md5($input) {
44
-		return new QueryFunction('MD5(' . $this->helper->quoteColumnName($input) . ')');
44
+		return new QueryFunction('MD5('.$this->helper->quoteColumnName($input).')');
45 45
 	}
46 46
 
47 47
 	public function concat($x, $y) {
48
-		return new QueryFunction('CONCAT(' . $this->helper->quoteColumnName($x) . ', ' . $this->helper->quoteColumnName($y) . ')');
48
+		return new QueryFunction('CONCAT('.$this->helper->quoteColumnName($x).', '.$this->helper->quoteColumnName($y).')');
49 49
 	}
50 50
 
51 51
 	public function substring($input, $start, $length = null) {
52 52
 		if ($length) {
53
-			return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ', ' . $this->helper->quoteColumnName($length) . ')');
53
+			return new QueryFunction('SUBSTR('.$this->helper->quoteColumnName($input).', '.$this->helper->quoteColumnName($start).', '.$this->helper->quoteColumnName($length).')');
54 54
 		} else {
55
-			return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ')');
55
+			return new QueryFunction('SUBSTR('.$this->helper->quoteColumnName($input).', '.$this->helper->quoteColumnName($start).')');
56 56
 		}
57 57
 	}
58 58
 
59 59
 	public function sum($field) {
60
-		return new QueryFunction('SUM(' . $this->helper->quoteColumnName($field) . ')');
60
+		return new QueryFunction('SUM('.$this->helper->quoteColumnName($field).')');
61 61
 	}
62 62
 
63 63
 	public function lower($field) {
64
-		return new QueryFunction('LOWER(' . $this->helper->quoteColumnName($field) . ')');
64
+		return new QueryFunction('LOWER('.$this->helper->quoteColumnName($field).')');
65 65
 	}
66 66
 
67 67
 	public function add($x, $y) {
68
-		return new QueryFunction($this->helper->quoteColumnName($x) . ' + ' . $this->helper->quoteColumnName($y));
68
+		return new QueryFunction($this->helper->quoteColumnName($x).' + '.$this->helper->quoteColumnName($y));
69 69
 	}
70 70
 
71 71
 	public function subtract($x, $y) {
72
-		return new QueryFunction($this->helper->quoteColumnName($x) . ' - ' . $this->helper->quoteColumnName($y));
72
+		return new QueryFunction($this->helper->quoteColumnName($x).' - '.$this->helper->quoteColumnName($y));
73 73
 	}
74 74
 
75 75
 	public function count($input) {
76
-		return new QueryFunction('COUNT(' . $this->helper->quoteColumnName($input) . ')');
76
+		return new QueryFunction('COUNT('.$this->helper->quoteColumnName($input).')');
77 77
 	}
78 78
 }
Please login to merge, or discard this patch.
lib/private/User/Database.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 * @return string display name
242 242
 	 */
243 243
 	public function getDisplayName($uid): string {
244
-		$uid = (string)$uid;
244
+		$uid = (string) $uid;
245 245
 		$this->loadUser($uid);
246 246
 		return empty($this->cache[$uid]['displayname']) ? $uid : $this->cache[$uid]['displayname'];
247 247
 	}
@@ -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
 			->orderBy('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;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 				if (!empty($newHash)) {
317 317
 					$this->setPassword($uid, $password);
318 318
 				}
319
-				return (string)$row['uid'];
319
+				return (string) $row['uid'];
320 320
 			}
321 321
 
322 322
 		}
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 	private function loadUser($uid) {
334 334
 		$this->fixDI();
335 335
 
336
-		$uid = (string)$uid;
336
+		$uid = (string) $uid;
337 337
 		if (!isset($this->cache[$uid])) {
338 338
 			//guests $uid could be NULL or ''
339 339
 			if ($uid === '') {
@@ -357,8 +357,8 @@  discard block
 block discarded – undo
357 357
 
358 358
 			// "uid" is primary key, so there can only be a single result
359 359
 			if ($row !== false) {
360
-				$this->cache[$uid]['uid'] = (string)$row['uid'];
361
-				$this->cache[$uid]['displayname'] = (string)$row['displayname'];
360
+				$this->cache[$uid]['uid'] = (string) $row['uid'];
361
+				$this->cache[$uid]['displayname'] = (string) $row['displayname'];
362 362
 			} else {
363 363
 				return false;
364 364
 			}
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
 	 */
378 378
 	public function getUsers($search = '', $limit = null, $offset = null) {
379 379
 		$users = $this->getDisplayNames($search, $limit, $offset);
380
-		$userIds = array_map(function ($uid) {
381
-			return (string)$uid;
380
+		$userIds = array_map(function($uid) {
381
+			return (string) $uid;
382 382
 		}, array_keys($users));
383 383
 		sort($userIds, SORT_STRING | SORT_FLAG_CASE);
384 384
 		return $userIds;
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 	 */
404 404
 	public function getHome(string $uid) {
405 405
 		if ($this->userExists($uid)) {
406
-			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid;
406
+			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$uid;
407 407
 		}
408 408
 
409 409
 		return false;
Please login to merge, or discard this patch.