Passed
Push — master ( 26e3d5...de64c9 )
by Joas
14:06 queued 13s
created
lib/private/Security/Bruteforce/Throttler.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	private function getCutoff(int $expire): \DateInterval {
94 94
 		$d1 = new \DateTime();
95 95
 		$d2 = clone $d1;
96
-		$d2->sub(new \DateInterval('PT' . $expire . 'S'));
96
+		$d2->sub(new \DateInterval('PT'.$expire.'S'));
97 97
 		return $d2->diff($d1);
98 98
 	}
99 99
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		$values = [
129 129
 			'action' => $action,
130 130
 			'occurred' => $this->timeFactory->getTime(),
131
-			'ip' => (string)$ipAddress,
131
+			'ip' => (string) $ipAddress,
132 132
 			'subnet' => $ipAddress->getSubnet(),
133 133
 			'metadata' => json_encode($metadata),
134 134
 		];
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		}
165 165
 
166 166
 		$keys = $this->config->getAppKeys('bruteForce');
167
-		$keys = array_filter($keys, function ($key) {
167
+		$keys = array_filter($keys, function($key) {
168 168
 			return 0 === strpos($key, 'whitelist_');
169 169
 		});
170 170
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 			$cx = explode('/', $cidr);
185 185
 			$addr = $cx[0];
186
-			$mask = (int)$cx[1];
186
+			$mask = (int) $cx[1];
187 187
 
188 188
 			// Do not compare ipv4 to ipv6
189 189
 			if (($type === 4 && !filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) ||
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 
196 196
 			$valid = true;
197 197
 			for ($i = 0; $i < $mask; $i++) {
198
-				$part = ord($addr[(int)($i / 8)]);
199
-				$orig = ord($ip[(int)($i / 8)]);
198
+				$part = ord($addr[(int) ($i / 8)]);
199
+				$orig = ord($ip[(int) ($i / 8)]);
200 200
 
201 201
 				$bitmask = 1 << (7 - ($i % 8));
202 202
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 		}
232 232
 
233 233
 		$ipAddress = new IpAddress($ip);
234
-		if ($this->isIPWhitelisted((string)$ipAddress)) {
234
+		if ($this->isIPWhitelisted((string) $ipAddress)) {
235 235
 			return 0;
236 236
 		}
237 237
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 	 */
290 290
 	public function resetDelay(string $ip, string $action, array $metadata): void {
291 291
 		$ipAddress = new IpAddress($ip);
292
-		if ($this->isIPWhitelisted((string)$ipAddress)) {
292
+		if ($this->isIPWhitelisted((string) $ipAddress)) {
293 293
 			return;
294 294
 		}
295 295
 
Please login to merge, or discard this patch.
lib/private/User/Backend.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 	/**
40 40
 	 * actions that user backends can define
41 41
 	 */
42
-	public const CREATE_USER = 1;			// 1 << 0
43
-	public const SET_PASSWORD = 16;			// 1 << 4
44
-	public const CHECK_PASSWORD = 256;			// 1 << 8
45
-	public const GET_HOME = 4096;			// 1 << 12
46
-	public const GET_DISPLAYNAME = 65536;		// 1 << 16
47
-	public const SET_DISPLAYNAME = 1048576;		// 1 << 20
48
-	public const PROVIDE_AVATAR = 16777216;		// 1 << 24
49
-	public const COUNT_USERS = 268435456;	// 1 << 28
42
+	public const CREATE_USER = 1; // 1 << 0
43
+	public const SET_PASSWORD = 16; // 1 << 4
44
+	public const CHECK_PASSWORD = 256; // 1 << 8
45
+	public const GET_HOME = 4096; // 1 << 12
46
+	public const GET_DISPLAYNAME = 65536; // 1 << 16
47
+	public const SET_DISPLAYNAME = 1048576; // 1 << 20
48
+	public const PROVIDE_AVATAR = 16777216; // 1 << 24
49
+	public const COUNT_USERS = 268435456; // 1 << 28
50 50
 
51 51
 	protected $possibleActions = [
52 52
 		self::CREATE_USER => 'createUser',
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 * compared with self::CREATE_USER etc.
87 87
 	 */
88 88
 	public function implementsActions($actions) {
89
-		return (bool)($this->getSupportedActions() & $actions);
89
+		return (bool) ($this->getSupportedActions() & $actions);
90 90
 	}
91 91
 
92 92
 	/**
Please login to merge, or discard this patch.
lib/private/Encryption/Keys/Storage.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 		$this->util = $util;
81 81
 
82 82
 		$this->encryption_base_dir = '/files_encryption';
83
-		$this->keys_base_dir = $this->encryption_base_dir .'/keys';
84
-		$this->backup_base_dir = $this->encryption_base_dir .'/backup';
83
+		$this->keys_base_dir = $this->encryption_base_dir.'/keys';
84
+		$this->backup_base_dir = $this->encryption_base_dir.'/backup';
85 85
 		$this->root_dir = $this->util->getKeyStorageRoot();
86 86
 		$this->crypto = $crypto;
87 87
 		$this->config = $config;
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 	public function getFileKey($path, $keyId, $encryptionModuleId) {
102 102
 		$realFile = $this->util->stripPartialFileExtension($path);
103 103
 		$keyDir = $this->getFileKeyDir($encryptionModuleId, $realFile);
104
-		$key = $this->getKey($keyDir . $keyId)['key'];
104
+		$key = $this->getKey($keyDir.$keyId)['key'];
105 105
 
106 106
 		if ($key === '' && $realFile !== $path) {
107 107
 			// Check if the part file has keys and use them, if no normal keys
108 108
 			// exist. This is required to fix copyBetweenStorage() when we
109 109
 			// rename a .part file over storage borders.
110 110
 			$keyDir = $this->getFileKeyDir($encryptionModuleId, $path);
111
-			$key = $this->getKey($keyDir . $keyId)['key'];
111
+			$key = $this->getKey($keyDir.$keyId)['key'];
112 112
 		}
113 113
 
114 114
 		return base64_decode($key);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function setFileKey($path, $keyId, $key, $encryptionModuleId) {
140 140
 		$keyDir = $this->getFileKeyDir($encryptionModuleId, $path);
141
-		return $this->setKey($keyDir . $keyId, [
141
+		return $this->setKey($keyDir.$keyId, [
142 142
 			'key' => base64_encode($key),
143 143
 		]);
144 144
 	}
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	 */
181 181
 	public function deleteFileKey($path, $keyId, $encryptionModuleId) {
182 182
 		$keyDir = $this->getFileKeyDir($encryptionModuleId, $path);
183
-		return !$this->view->file_exists($keyDir . $keyId) || $this->view->unlink($keyDir . $keyId);
183
+		return !$this->view->file_exists($keyDir.$keyId) || $this->view->unlink($keyDir.$keyId);
184 184
 	}
185 185
 
186 186
 	/**
@@ -209,10 +209,10 @@  discard block
 block discarded – undo
209 209
 	 */
210 210
 	protected function constructUserKeyPath($encryptionModuleId, $keyId, $uid) {
211 211
 		if ($uid === null) {
212
-			$path = $this->root_dir . '/' . $this->encryption_base_dir . '/' . $encryptionModuleId . '/' . $keyId;
212
+			$path = $this->root_dir.'/'.$this->encryption_base_dir.'/'.$encryptionModuleId.'/'.$keyId;
213 213
 		} else {
214
-			$path = $this->root_dir . '/' . $uid . $this->encryption_base_dir . '/'
215
-				. $encryptionModuleId . '/' . $uid . '.' . $keyId;
214
+			$path = $this->root_dir.'/'.$uid.$this->encryption_base_dir.'/'
215
+				. $encryptionModuleId.'/'.$uid.'.'.$keyId;
216 216
 		}
217 217
 
218 218
 		return \OC\Files\Filesystem::normalizePath($path);
@@ -369,12 +369,12 @@  discard block
 block discarded – undo
369 369
 
370 370
 		// in case of system wide mount points the keys are stored directly in the data directory
371 371
 		if ($this->util->isSystemWideMountPoint($filename, $owner)) {
372
-			$keyPath = $this->root_dir . '/' . $this->keys_base_dir . $filename . '/';
372
+			$keyPath = $this->root_dir.'/'.$this->keys_base_dir.$filename.'/';
373 373
 		} else {
374
-			$keyPath = $this->root_dir . '/' . $owner . $this->keys_base_dir . $filename . '/';
374
+			$keyPath = $this->root_dir.'/'.$owner.$this->keys_base_dir.$filename.'/';
375 375
 		}
376 376
 
377
-		return Filesystem::normalizePath($keyPath . $encryptionModuleId . '/', false);
377
+		return Filesystem::normalizePath($keyPath.$encryptionModuleId.'/', false);
378 378
 	}
379 379
 
380 380
 	/**
@@ -429,13 +429,13 @@  discard block
 block discarded – undo
429 429
 	 * @since 12.0.0
430 430
 	 */
431 431
 	public function backupUserKeys($encryptionModuleId, $purpose, $uid) {
432
-		$source = $uid . $this->encryption_base_dir . '/' . $encryptionModuleId;
433
-		$backupDir = $uid . $this->backup_base_dir;
432
+		$source = $uid.$this->encryption_base_dir.'/'.$encryptionModuleId;
433
+		$backupDir = $uid.$this->backup_base_dir;
434 434
 		if (!$this->view->file_exists($backupDir)) {
435 435
 			$this->view->mkdir($backupDir);
436 436
 		}
437 437
 
438
-		$backupDir = $backupDir . '/' . $purpose . '.' . $encryptionModuleId . '.' . $this->getTimestamp();
438
+		$backupDir = $backupDir.'/'.$purpose.'.'.$encryptionModuleId.'.'.$this->getTimestamp();
439 439
 		$this->view->mkdir($backupDir);
440 440
 
441 441
 		return $this->view->copy($source, $backupDir);
@@ -461,9 +461,9 @@  discard block
 block discarded – undo
461 461
 		$systemWideMountPoint = $this->util->isSystemWideMountPoint($relativePath, $owner);
462 462
 
463 463
 		if ($systemWideMountPoint) {
464
-			$systemPath = $this->root_dir . '/' . $this->keys_base_dir . $relativePath . '/';
464
+			$systemPath = $this->root_dir.'/'.$this->keys_base_dir.$relativePath.'/';
465 465
 		} else {
466
-			$systemPath = $this->root_dir . '/' . $owner . $this->keys_base_dir . $relativePath . '/';
466
+			$systemPath = $this->root_dir.'/'.$owner.$this->keys_base_dir.$relativePath.'/';
467 467
 		}
468 468
 
469 469
 		return  Filesystem::normalizePath($systemPath, false);
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 			$sub_dirs = explode('/', ltrim($path, '/'));
481 481
 			$dir = '';
482 482
 			foreach ($sub_dirs as $sub_dir) {
483
-				$dir .= '/' . $sub_dir;
483
+				$dir .= '/'.$sub_dir;
484 484
 				if (!$this->view->is_dir($dir)) {
485 485
 					$this->view->mkdir($dir);
486 486
 				}
Please login to merge, or discard this patch.
lib/private/legacy/OC_API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -375,7 +375,7 @@
 block discarded – undo
375 375
 		}
376 376
 
377 377
 		foreach ($result->getHeaders() as $name => $value) {
378
-			header($name . ': ' . $value);
378
+			header($name.': '.$value);
379 379
 		}
380 380
 
381 381
 		$meta = $result->getMeta();
Please login to merge, or discard this patch.
lib/private/legacy/OC_FileChunking.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 	public function isComplete() {
86 86
 		$prefix = $this->getPrefix();
87 87
 		$cache = $this->getCache();
88
-		$chunkcount = (int)$this->info['chunkcount'];
88
+		$chunkcount = (int) $this->info['chunkcount'];
89 89
 
90 90
 		for ($i = ($chunkcount - 1); $i >= 0; $i--) {
91 91
 			if (!$cache->hasKey($prefix.$i)) {
Please login to merge, or discard this patch.
lib/private/legacy/template/functions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 function emit_css_tag($href, $opts = '') {
50 50
 	$s = '<link rel="stylesheet"';
51 51
 	if (!empty($href)) {
52
-		$s .= ' href="' . $href .'"';
52
+		$s .= ' href="'.$href.'"';
53 53
 	}
54 54
 	if (!empty($opts)) {
55 55
 		$s .= ' '.$opts;
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
  */
78 78
 function emit_script_tag($src, $script_content = '') {
79 79
 	$defer_str = ' defer';
80
-	$s = '<script nonce="' . \OC::$server->getContentSecurityPolicyNonceManager()->getNonce() . '"';
80
+	$s = '<script nonce="'.\OC::$server->getContentSecurityPolicyNonceManager()->getNonce().'"';
81 81
 	if (!empty($src)) {
82 82
 		// emit script tag for deferred loading from $src
83
-		$s .= $defer_str.' src="' . $src .'">';
83
+		$s .= $defer_str.' src="'.$src.'">';
84 84
 	} elseif (!empty($script_content)) {
85 85
 		// emit script tag for inline script from $script_content without defer (see MDN)
86 86
 		$s .= ">\n".$script_content."\n";
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
 function component($app, $file) {
197 197
 	if (is_array($file)) {
198 198
 		foreach ($file as $f) {
199
-			$url = link_to($app, 'component/' . $f . '.html');
199
+			$url = link_to($app, 'component/'.$f.'.html');
200 200
 			OC_Util::addHeader('link', ['rel' => 'import', 'href' => $url]);
201 201
 		}
202 202
 	} else {
203
-		$url = link_to($app, 'component/' . $file . '.html');
203
+		$url = link_to($app, 'component/'.$file.'.html');
204 204
 		OC_Util::addHeader('link', ['rel' => 'import', 'href' => $url]);
205 205
 	}
206 206
 }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 function strip_time($timestamp) {
286 286
 	$date = new \DateTime("@{$timestamp}");
287 287
 	$date->setTime(0, 0, 0);
288
-	return (int)$date->format('U');
288
+	return (int) $date->format('U');
289 289
 }
290 290
 
291 291
 /**
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 			$label = $label[$label_name];
330 330
 		}
331 331
 		$select = in_array($value, $selected) ? ' selected="selected"' : '';
332
-		$html .= '<option value="' . \OCP\Util::sanitizeHTML($value) . '"' . $select . '>' . \OCP\Util::sanitizeHTML($label) . '</option>'."\n";
332
+		$html .= '<option value="'.\OCP\Util::sanitizeHTML($value).'"'.$select.'>'.\OCP\Util::sanitizeHTML($label).'</option>'."\n";
333 333
 	}
334 334
 	return $html;
335 335
 }
Please login to merge, or discard this patch.
lib/private/legacy/OC_Hook.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
 		// Call all slots
104 104
 		foreach (self::$registered[$signalClass][$signalName] as $i) {
105 105
 			try {
106
-				call_user_func([ $i["class"], $i["name"] ], $params);
106
+				call_user_func([$i["class"], $i["name"]], $params);
107 107
 			} catch (Exception $e) {
108 108
 				self::$thrownExceptions[] = $e;
109 109
 				\OC::$server->getLogger()->logException($e);
Please login to merge, or discard this patch.
lib/private/Route/Route.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
 	 * @return void
150 150
 	 */
151 151
 	public function actionInclude($file) {
152
-		$function = function ($param) use ($file) {
152
+		$function = function($param) use ($file) {
153 153
 			unset($param["_route"]);
154 154
 			$_GET = array_merge($_GET, $param);
155 155
 			unset($param);
Please login to merge, or discard this patch.
lib/private/AppFramework/Middleware/Security/SameSiteCookieMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
 		foreach ($policies as $policy) {
96 96
 			header(
97 97
 				sprintf(
98
-					'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;' . $secureCookie . 'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s',
98
+					'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;'.$secureCookie.'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s',
99 99
 					$cookiePrefix,
100 100
 					$policy,
101 101
 					$cookieParams['path'],
Please login to merge, or discard this patch.