Passed
Push — master ( b48341...39d134 )
by Roeland
17:15 queued 04:36
created
apps/files_external/lib/config.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -240,12 +240,12 @@  discard block
 block discarded – undo
240 240
 			return StorageNotAvailableException::STATUS_SUCCESS;
241 241
 		}
242 242
 		foreach ($options as $key => &$option) {
243
-			if($key === 'password') {
243
+			if ($key === 'password') {
244 244
 				// no replacements in passwords
245 245
 				continue;
246 246
 			}
247 247
 			$option = self::substitutePlaceholdersInConfig($option);
248
-			if(!self::arePlaceholdersSubstituted($option)) {
248
+			if (!self::arePlaceholdersSubstituted($option)) {
249 249
 				\OC::$server->getLogger()->error(
250 250
 					'A placeholder was not substituted: {option} for mount type {class}',
251 251
 					[
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
 
286 286
 	public static function arePlaceholdersSubstituted($option):bool {
287 287
 		$result = true;
288
-		if(is_array($option)) {
288
+		if (is_array($option)) {
289 289
 			foreach ($option as $optionItem) {
290
-				if(is_array($optionItem)) {
290
+				if (is_array($optionItem)) {
291 291
 					$result = $result && self::arePlaceholdersSubstituted($option);
292 292
 				}
293 293
 			}
@@ -307,11 +307,11 @@  discard block
 block discarded – undo
307 307
 	 */
308 308
 	public static function readData($user = null) {
309 309
 		if (isset($user)) {
310
-			$jsonFile = \OC::$server->getUserManager()->get($user)->getHome() . '/mount.json';
310
+			$jsonFile = \OC::$server->getUserManager()->get($user)->getHome().'/mount.json';
311 311
 		} else {
312 312
 			$config = \OC::$server->getConfig();
313
-			$datadir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/');
314
-			$jsonFile = $config->getSystemValue('mount_file', $datadir . '/mount.json');
313
+			$datadir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data/');
314
+			$jsonFile = $config->getSystemValue('mount_file', $datadir.'/mount.json');
315 315
 		}
316 316
 		if (is_file($jsonFile)) {
317 317
 			$mountPoints = json_decode(file_get_contents($jsonFile), true);
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		foreach ($backends as $backend) {
338 338
 			foreach ($backend->checkDependencies() as $dependency) {
339 339
 				if ($message = $dependency->getMessage()) {
340
-					$message .= '<p>' . $message . '</p>';
340
+					$message .= '<p>'.$message.'</p>';
341 341
 				} else {
342 342
 					$dependencyGroups[$dependency->getDependency()][] = $backend;
343 343
 				}
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 
347 347
 		foreach ($dependencyGroups as $module => $dependants) {
348 348
 			$backends = implode(', ', array_map(function($backend) {
349
-				return '"' . $backend->getText() . '"';
349
+				return '"'.$backend->getText().'"';
350 350
 			}, $dependants));
351
-			$message .= '<p>' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends) . '</p>';
351
+			$message .= '<p>'.OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends).'</p>';
352 352
 		}
353 353
 
354 354
 		return $message;
@@ -365,11 +365,11 @@  discard block
 block discarded – undo
365 365
 	private static function getSingleDependencyMessage(\OCP\IL10N $l, $module, $backend) {
366 366
 		switch (strtolower($module)) {
367 367
 			case 'curl':
368
-				return (string)$l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
368
+				return (string) $l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
369 369
 			case 'ftp':
370
-				return (string)$l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
370
+				return (string) $l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
371 371
 			default:
372
-				return (string)$l->t('"%1$s" is not installed. Mounting of %2$s is not possible. Please ask your system administrator to install it.', [$module, $backend]);
372
+				return (string) $l->t('"%1$s" is not installed. Mounting of %2$s is not possible. Please ask your system administrator to install it.', [$module, $backend]);
373 373
 		}
374 374
 	}
375 375
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 		$cipher = self::getCipher();
415 415
 		$iv = \OC::$server->getSecureRandom()->generate(16);
416 416
 		$cipher->setIV($iv);
417
-		return base64_encode($iv . $cipher->encrypt($password));
417
+		return base64_encode($iv.$cipher->encrypt($password));
418 418
 	}
419 419
 
420 420
 	/**
Please login to merge, or discard this patch.