Passed
Push — master ( c965d2...08bd83 )
by Morris
23:20 queued 12:58
created
apps/files_external/lib/Service/DBConfigService.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	public function getAdminMountsForMultiple($type, array $values) {
185 185
 		$builder = $this->connection->getQueryBuilder();
186
-		$params = array_map(function ($value) use ($builder) {
186
+		$params = array_map(function($value) use ($builder) {
187 187
 			return $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR);
188 188
 		}, $values);
189 189
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 				'type' => $builder->createNamedParameter($type, IQueryBuilder::PARAM_INT)
238 238
 			]);
239 239
 		$query->execute();
240
-		return (int)$this->connection->lastInsertId('*PREFIX*external_mounts');
240
+		return (int) $this->connection->lastInsertId('*PREFIX*external_mounts');
241 241
 	}
242 242
 
243 243
 	/**
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 				->setValue('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR))
310 310
 				->setValue('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR))
311 311
 				->execute();
312
-		} catch(UniqueConstraintViolationException $e) {
312
+		} catch (UniqueConstraintViolationException $e) {
313 313
 			$builder = $this->connection->getQueryBuilder();
314 314
 			$query = $builder->update('external_config')
315 315
 				->set('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR))
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 				->setValue('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR))
333 333
 				->setValue('value', $builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR))
334 334
 				->execute();
335
-		} catch(UniqueConstraintViolationException $e) {
335
+		} catch (UniqueConstraintViolationException $e) {
336 336
 			$builder = $this->connection->getQueryBuilder();
337 337
 			$query = $builder->update('external_options')
338 338
 				->set('value', $builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR))
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 				->setValue('type', $builder->createNamedParameter($type))
351 351
 				->setValue('value', $builder->createNamedParameter($value))
352 352
 				->execute();
353
-		} catch(UniqueConstraintViolationException $e) {
353
+		} catch (UniqueConstraintViolationException $e) {
354 354
 			// applicable exists already
355 355
 		}
356 356
 	}
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 		}
383 383
 		$uniqueMounts = array_values($uniqueMounts);
384 384
 
385
-		$mountIds = array_map(function ($mount) {
385
+		$mountIds = array_map(function($mount) {
386 386
 			return $mount['mount_id'];
387 387
 		}, $uniqueMounts);
388 388
 		$mountIds = array_values(array_unique($mountIds));
@@ -391,9 +391,9 @@  discard block
 block discarded – undo
391 391
 		$config = $this->getConfigForMounts($mountIds);
392 392
 		$options = $this->getOptionsForMounts($mountIds);
393 393
 
394
-		return array_map(function ($mount, $applicable, $config, $options) {
395
-			$mount['type'] = (int)$mount['type'];
396
-			$mount['priority'] = (int)$mount['priority'];
394
+		return array_map(function($mount, $applicable, $config, $options) {
395
+			$mount['type'] = (int) $mount['type'];
396
+			$mount['priority'] = (int) $mount['priority'];
397 397
 			$mount['applicable'] = $applicable;
398 398
 			$mount['config'] = $config;
399 399
 			$mount['options'] = $options;
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 		}
416 416
 		$builder = $this->connection->getQueryBuilder();
417 417
 		$fields[] = 'mount_id';
418
-		$placeHolders = array_map(function ($id) use ($builder) {
418
+		$placeHolders = array_map(function($id) use ($builder) {
419 419
 			return $builder->createPositionalParameter($id, IQueryBuilder::PARAM_INT);
420 420
 		}, $mountIds);
421 421
 		$query = $builder->select($fields)
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 		}
430 430
 		foreach ($rows as $row) {
431 431
 			if (isset($row['type'])) {
432
-				$row['type'] = (int)$row['type'];
432
+				$row['type'] = (int) $row['type'];
433 433
 			}
434 434
 			$result[$row['mount_id']][] = $row;
435 435
 		}
@@ -460,8 +460,8 @@  discard block
 block discarded – undo
460 460
 	public function getOptionsForMounts($mountIds) {
461 461
 		$mountOptions = $this->selectForMounts('external_options', ['key', 'value'], $mountIds);
462 462
 		$optionsMap = array_map([$this, 'createKeyValueMap'], $mountOptions);
463
-		return array_map(function (array $options) {
464
-			return array_map(function ($option) {
463
+		return array_map(function(array $options) {
464
+			return array_map(function($option) {
465 465
 				return json_decode($option);
466 466
 			}, $options);
467 467
 		}, $optionsMap);
@@ -472,16 +472,16 @@  discard block
 block discarded – undo
472 472
 	 * @return array ['key1' => $value1, ...]
473 473
 	 */
474 474
 	private function createKeyValueMap(array $keyValuePairs) {
475
-		$decryptedPairts = array_map(function ($pair) {
475
+		$decryptedPairts = array_map(function($pair) {
476 476
 			if ($pair['key'] === 'password') {
477 477
 				$pair['value'] = $this->decryptValue($pair['value']);
478 478
 			}
479 479
 			return $pair;
480 480
 		}, $keyValuePairs);
481
-		$keys = array_map(function ($pair) {
481
+		$keys = array_map(function($pair) {
482 482
 			return $pair['key'];
483 483
 		}, $decryptedPairts);
484
-		$values = array_map(function ($pair) {
484
+		$values = array_map(function($pair) {
485 485
 			return $pair['value'];
486 486
 		}, $decryptedPairts);
487 487
 
Please login to merge, or discard this patch.