Passed
Push — master ( 773e28...7e8ddc )
by Joas
13:16 queued 11s
created
lib/private/Cache/File.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 			$rootView = new View();
56 56
 			$user = \OC::$server->getUserSession()->getUser();
57 57
 			Filesystem::initMountPoints($user->getUID());
58
-			if (!$rootView->file_exists('/' . $user->getUID() . '/cache')) {
59
-				$rootView->mkdir('/' . $user->getUID() . '/cache');
58
+			if (!$rootView->file_exists('/'.$user->getUID().'/cache')) {
59
+				$rootView->mkdir('/'.$user->getUID().'/cache');
60 60
 			}
61
-			$this->storage = new View('/' . $user->getUID() . '/cache');
61
+			$this->storage = new View('/'.$user->getUID().'/cache');
62 62
 			return $this->storage;
63 63
 		} else {
64 64
 			\OCP\Util::writeLog('core', 'Can\'t get cache storage, user not logged in', ILogger::ERROR);
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
 		// unique id to avoid chunk collision, just in case
109 109
 		$uniqueId = \OC::$server->getSecureRandom()->generate(
110 110
 			16,
111
-			ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER
111
+			ISecureRandom::CHAR_DIGITS.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER
112 112
 		);
113 113
 
114 114
 		// use part file to prevent hasKey() to find the key
115 115
 		// while it is being written
116
-		$keyPart = $key . '.' . $uniqueId . '.part';
116
+		$keyPart = $key.'.'.$uniqueId.'.part';
117 117
 		if ($storage and $storage->file_put_contents($keyPart, $value)) {
118 118
 			if ($ttl === 0) {
119 119
 				$ttl = 86400; // 60*60*24
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 			if (is_resource($dh)) {
163 163
 				while (($file = readdir($dh)) !== false) {
164 164
 					if ($file != '.' and $file != '..' and ($prefix === '' || strpos($file, $prefix) === 0)) {
165
-						$storage->unlink('/' . $file);
165
+						$storage->unlink('/'.$file);
166 166
 					}
167 167
 				}
168 168
 			}
@@ -187,17 +187,17 @@  discard block
 block discarded – undo
187 187
 			while (($file = readdir($dh)) !== false) {
188 188
 				if ($file != '.' and $file != '..') {
189 189
 					try {
190
-						$mtime = $storage->filemtime('/' . $file);
190
+						$mtime = $storage->filemtime('/'.$file);
191 191
 						if ($mtime < $now) {
192
-							$storage->unlink('/' . $file);
192
+							$storage->unlink('/'.$file);
193 193
 						}
194 194
 					} catch (\OCP\Lock\LockedException $e) {
195 195
 						// ignore locked chunks
196
-						\OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', ['app' => 'core']);
196
+						\OC::$server->getLogger()->debug('Could not cleanup locked chunk "'.$file.'"', ['app' => 'core']);
197 197
 					} catch (\OCP\Files\ForbiddenException $e) {
198
-						\OC::$server->getLogger()->debug('Could not cleanup forbidden chunk "' . $file . '"', ['app' => 'core']);
198
+						\OC::$server->getLogger()->debug('Could not cleanup forbidden chunk "'.$file.'"', ['app' => 'core']);
199 199
 					} catch (\OCP\Files\LockNotAcquiredException $e) {
200
-						\OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', ['app' => 'core']);
200
+						\OC::$server->getLogger()->debug('Could not cleanup locked chunk "'.$file.'"', ['app' => 'core']);
201 201
 					}
202 202
 				}
203 203
 			}
Please login to merge, or discard this patch.
lib/private/Route/CachingRouter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 	 */
52 52
 	public function generate($name, $parameters = [], $absolute = false) {
53 53
 		asort($parameters);
54
-		$key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . (int)$absolute;
54
+		$key = $this->context->getHost().'#'.$this->context->getBaseUrl().$name.sha1(json_encode($parameters)).(int) $absolute;
55 55
 		$cachedKey = $this->cache->get($key);
56 56
 		if ($cachedKey) {
57 57
 			return $cachedKey;
Please login to merge, or discard this patch.
lib/private/Repair/Collation.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		$tables = $this->getAllNonUTF8BinTables($this->connection);
79 79
 		foreach ($tables as $table) {
80 80
 			$output->info("Change row format for $table ...");
81
-			$query = $this->connection->prepare('ALTER TABLE `' . $table . '` ROW_FORMAT = DYNAMIC;');
81
+			$query = $this->connection->prepare('ALTER TABLE `'.$table.'` ROW_FORMAT = DYNAMIC;');
82 82
 			try {
83 83
 				$query->execute();
84 84
 			} catch (DriverException $e) {
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
 			$output->info("Change collation for $table ...");
93 93
 			if ($characterSet === 'utf8mb4') {
94 94
 				// need to set row compression first
95
-				$query = $this->connection->prepare('ALTER TABLE `' . $table . '` ROW_FORMAT=COMPRESSED;');
95
+				$query = $this->connection->prepare('ALTER TABLE `'.$table.'` ROW_FORMAT=COMPRESSED;');
96 96
 				$query->execute();
97 97
 			}
98
-			$query = $this->connection->prepare('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET ' . $characterSet . ' COLLATE ' . $characterSet . '_bin;');
98
+			$query = $this->connection->prepare('ALTER TABLE `'.$table.'` CONVERT TO CHARACTER SET '.$characterSet.' COLLATE '.$characterSet.'_bin;');
99 99
 			try {
100 100
 				$query->execute();
101 101
 			} catch (DriverException $e) {
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 
122 122
 		// fetch tables by columns
123 123
 		$statement = $connection->executeQuery(
124
-			"SELECT DISTINCT(TABLE_NAME) AS `table`" .
125
-			"	FROM INFORMATION_SCHEMA . COLUMNS" .
126
-			"	WHERE TABLE_SCHEMA = ?" .
127
-			"	AND (COLLATION_NAME <> '" . $characterSet . "_bin' OR CHARACTER_SET_NAME <> '" . $characterSet . "')" .
124
+			"SELECT DISTINCT(TABLE_NAME) AS `table`".
125
+			"	FROM INFORMATION_SCHEMA . COLUMNS".
126
+			"	WHERE TABLE_SCHEMA = ?".
127
+			"	AND (COLLATION_NAME <> '".$characterSet."_bin' OR CHARACTER_SET_NAME <> '".$characterSet."')".
128 128
 			"	AND TABLE_NAME LIKE '*PREFIX*%'",
129 129
 			[$dbName]
130 130
 		);
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
 
137 137
 		// fetch tables by collation
138 138
 		$statement = $connection->executeQuery(
139
-			"SELECT DISTINCT(TABLE_NAME) AS `table`" .
140
-			"	FROM INFORMATION_SCHEMA . TABLES" .
141
-			"	WHERE TABLE_SCHEMA = ?" .
142
-			"	AND TABLE_COLLATION <> '" . $characterSet . "_bin'" .
139
+			"SELECT DISTINCT(TABLE_NAME) AS `table`".
140
+			"	FROM INFORMATION_SCHEMA . TABLES".
141
+			"	WHERE TABLE_SCHEMA = ?".
142
+			"	AND TABLE_COLLATION <> '".$characterSet."_bin'".
143 143
 			"	AND TABLE_NAME LIKE '*PREFIX*%'",
144 144
 			[$dbName]
145 145
 		);
Please login to merge, or discard this patch.
lib/private/Archive/TAR.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -91,20 +91,20 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function addFolder($path) {
93 93
 		$tmpBase = \OC::$server->getTempManager()->getTemporaryFolder();
94
-		$path = rtrim($path, '/') . '/';
94
+		$path = rtrim($path, '/').'/';
95 95
 		if ($this->fileExists($path)) {
96 96
 			return false;
97 97
 		}
98 98
 		$parts = explode('/', $path);
99 99
 		$folder = $tmpBase;
100 100
 		foreach ($parts as $part) {
101
-			$folder .= '/' . $part;
101
+			$folder .= '/'.$part;
102 102
 			if (!is_dir($folder)) {
103 103
 				mkdir($folder);
104 104
 			}
105 105
 		}
106
-		$result = $this->tar->addModify([$tmpBase . $path], '', $tmpBase);
107
-		rmdir($tmpBase . $path);
106
+		$result = $this->tar->addModify([$tmpBase.$path], '', $tmpBase);
107
+		rmdir($tmpBase.$path);
108 108
 		$this->fileList = false;
109 109
 		$this->cachedHeaders = false;
110 110
 		return $result;
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
 		//no proper way to delete, rename entire archive, rename file and remake archive
142 142
 		$tmp = \OC::$server->getTempManager()->getTemporaryFolder();
143 143
 		$this->tar->extract($tmp);
144
-		rename($tmp . $source, $tmp . $dest);
144
+		rename($tmp.$source, $tmp.$dest);
145 145
 		$this->tar = null;
146 146
 		unlink($this->path);
147 147
 		$types = [null, 'gz', 'bz'];
148 148
 		$this->tar = new \Archive_Tar($this->path, $types[self::getTarType($this->path)]);
149
-		$this->tar->createModify([$tmp], '', $tmp . '/');
149
+		$this->tar->createModify([$tmp], '', $tmp.'/');
150 150
 		$this->fileList = false;
151 151
 		$this->cachedHeaders = false;
152 152
 		return true;
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
 		}
162 162
 		foreach ($this->cachedHeaders as $header) {
163 163
 			if ($file == $header['filename']
164
-				or $file . '/' == $header['filename']
165
-				or '/' . $file . '/' == $header['filename']
166
-				or '/' . $file == $header['filename']
164
+				or $file.'/' == $header['filename']
165
+				or '/'.$file.'/' == $header['filename']
166
+				or '/'.$file == $header['filename']
167 167
 			) {
168 168
 				return $header;
169 169
 			}
@@ -262,13 +262,13 @@  discard block
 block discarded – undo
262 262
 		if (!$this->fileExists($path)) {
263 263
 			return false;
264 264
 		}
265
-		if ($this->fileExists('/' . $path)) {
266
-			$success = $this->tar->extractList(['/' . $path], $tmp);
265
+		if ($this->fileExists('/'.$path)) {
266
+			$success = $this->tar->extractList(['/'.$path], $tmp);
267 267
 		} else {
268 268
 			$success = $this->tar->extractList([$path], $tmp);
269 269
 		}
270 270
 		if ($success) {
271
-			rename($tmp . $path, $dest);
271
+			rename($tmp.$path, $dest);
272 272
 		}
273 273
 		\OCP\Files::rmdirr($tmp);
274 274
 		return $success;
@@ -292,10 +292,10 @@  discard block
 block discarded – undo
292 292
 	 */
293 293
 	public function fileExists($path) {
294 294
 		$files = $this->getFiles();
295
-		if ((array_search($path, $files) !== false) or (array_search($path . '/', $files) !== false)) {
295
+		if ((array_search($path, $files) !== false) or (array_search($path.'/', $files) !== false)) {
296 296
 			return true;
297 297
 		} else {
298
-			$folderPath = rtrim($path, '/') . '/';
298
+			$folderPath = rtrim($path, '/').'/';
299 299
 			$pathLength = strlen($folderPath);
300 300
 			foreach ($files as $file) {
301 301
 				if (strlen($file) > $pathLength and substr($file, 0, $pathLength) == $folderPath) {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 			}
305 305
 		}
306 306
 		if ($path[0] != '/') { //not all programs agree on the use of a leading /
307
-			return $this->fileExists('/' . $path);
307
+			return $this->fileExists('/'.$path);
308 308
 		} else {
309 309
 			return false;
310 310
 		}
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 		//no proper way to delete, extract entire archive, delete file and remake archive
326 326
 		$tmp = \OC::$server->getTempManager()->getTemporaryFolder();
327 327
 		$this->tar->extract($tmp);
328
-		\OCP\Files::rmdirr($tmp . $path);
328
+		\OCP\Files::rmdirr($tmp.$path);
329 329
 		$this->tar = null;
330 330
 		unlink($this->path);
331 331
 		$this->reopen();
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 			return fopen($tmpFile, $mode);
357 357
 		} else {
358 358
 			$handle = fopen($tmpFile, $mode);
359
-			return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
359
+			return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) {
360 360
 				$this->writeBack($tmpFile, $path);
361 361
 			});
362 362
 		}
Please login to merge, or discard this patch.
lib/private/Authentication/WebAuthn/CredentialRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 		$uid = $publicKeyCredentialUserEntity->getId();
57 57
 		$entities = $this->credentialMapper->findAllForUid($uid);
58 58
 
59
-		return array_map(function (PublicKeyCredentialEntity $entity) {
59
+		return array_map(function(PublicKeyCredentialEntity $entity) {
60 60
 			return $entity->toPublicKeyCredentialSource();
61 61
 		}, $entities);
62 62
 	}
Please login to merge, or discard this patch.
lib/private/Files/Stream/SeekableHttpStream.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		]);
63 63
 
64 64
 		SeekableHttpStream::registerIfNeeded();
65
-		return fopen(SeekableHttpStream::PROTOCOL . '://', 'r', false, $context);
65
+		return fopen(SeekableHttpStream::PROTOCOL.'://', 'r', false, $context);
66 66
 	}
67 67
 
68 68
 	/** @var resource */
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	private $offset = 0;
78 78
 
79 79
 	private function reconnect(int $start) {
80
-		$range = $start . '-';
80
+		$range = $start.'-';
81 81
 		if ($this->current != null) {
82 82
 			fclose($this->current);
83 83
 		}
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		}
90 90
 
91 91
 		$responseHead = stream_get_meta_data($this->current)['wrapper_data'];
92
-		$rangeHeaders = array_values(array_filter($responseHead, function ($v) {
92
+		$rangeHeaders = array_values(array_filter($responseHead, function($v) {
93 93
 			return preg_match('#^content-range:#i', $v) === 1;
94 94
 		}));
95 95
 		if (!$rangeHeaders) {
Please login to merge, or discard this patch.
lib/private/legacy/OC_User.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 				case 'database':
92 92
 				case 'mysql':
93 93
 				case 'sqlite':
94
-					\OCP\Util::writeLog('core', 'Adding user backend ' . $backend . '.', ILogger::DEBUG);
94
+					\OCP\Util::writeLog('core', 'Adding user backend '.$backend.'.', ILogger::DEBUG);
95 95
 					self::$_usedBackends[$backend] = new \OC\User\Database();
96 96
 					\OC::$server->getUserManager()->registerBackend(self::$_usedBackends[$backend]);
97 97
 					break;
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 					\OC::$server->getUserManager()->registerBackend(self::$_usedBackends[$backend]);
101 101
 					break;
102 102
 				default:
103
-					\OCP\Util::writeLog('core', 'Adding default user backend ' . $backend . '.', ILogger::DEBUG);
104
-					$className = 'OC_USER_' . strtoupper($backend);
103
+					\OCP\Util::writeLog('core', 'Adding default user backend '.$backend.'.', ILogger::DEBUG);
104
+					$className = 'OC_USER_'.strtoupper($backend);
105 105
 					self::$_usedBackends[$backend] = new $className();
106 106
 					\OC::$server->getUserManager()->registerBackend(self::$_usedBackends[$backend]);
107 107
 					break;
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 					self::useBackend($backend);
146 146
 					self::$_setupedBackends[] = $i;
147 147
 				} else {
148
-					\OCP\Util::writeLog('core', 'User backend ' . $class . ' already initialized.', ILogger::DEBUG);
148
+					\OCP\Util::writeLog('core', 'User backend '.$class.' already initialized.', ILogger::DEBUG);
149 149
 				}
150 150
 			} else {
151
-				\OCP\Util::writeLog('core', 'User backend ' . $class . ' not found.', ILogger::ERROR);
151
+				\OCP\Util::writeLog('core', 'User backend '.$class.' not found.', ILogger::ERROR);
152 152
 			}
153 153
 		}
154 154
 	}
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 		}
271 271
 
272 272
 		$logoutUrl = $urlGenerator->linkToRoute('core.login.logout');
273
-		$logoutUrl .= '?requesttoken=' . urlencode(\OCP\Util::callRegister());
273
+		$logoutUrl .= '?requesttoken='.urlencode(\OCP\Util::callRegister());
274 274
 
275 275
 		return $logoutUrl;
276 276
 	}
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 		if ($user) {
363 363
 			return $user->getHome();
364 364
 		} else {
365
-			return \OC::$server->getSystemConfig()->getValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $uid;
365
+			return \OC::$server->getSystemConfig()->getValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$uid;
366 366
 		}
367 367
 	}
368 368
 
Please login to merge, or discard this patch.
core/Controller/WebAuthnController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
 			'preLoginNameUsedAsUserName',
78 78
 			['uid' => &$uid]
79 79
 		);
80
-		$this->logger->debug('Got UID: ' . $uid);
80
+		$this->logger->debug('Got UID: '.$uid);
81 81
 
82 82
 		$publicKeyCredentialRequestOptions = $this->webAuthnManger->startAuthentication($uid, $this->request->getServerHost());
83 83
 		$this->session->set(self::WEBAUTHN_LOGIN, json_encode($publicKeyCredentialRequestOptions));
Please login to merge, or discard this patch.
core/templates/loginflow/grant.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 	<h2><?php p($l->t('Account access')) ?></h2>
32 32
 	<p class="info">
33 33
 		<?php print_unescaped($l->t('You are about to grant %1$s access to your %2$s account.', [
34
-			'<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>',
34
+			'<strong>'.\OCP\Util::sanitizeHTML($_['client']).'</strong>',
35 35
 			\OCP\Util::sanitizeHTML($_['instanceName'])
36 36
 		])) ?>
37 37
 	</p>
Please login to merge, or discard this patch.