Completed
Pull Request — master (#6196)
by Robin
13:12
created
apps/files_external/lib/Service/StoragesService.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
 	}
73 73
 
74 74
 	protected function getStorageConfigFromDBMount(array $mount) {
75
-		$applicableUsers = array_filter($mount['applicable'], function ($applicable) {
75
+		$applicableUsers = array_filter($mount['applicable'], function($applicable) {
76 76
 			return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_USER;
77 77
 		});
78
-		$applicableUsers = array_map(function ($applicable) {
78
+		$applicableUsers = array_map(function($applicable) {
79 79
 			return $applicable['value'];
80 80
 		}, $applicableUsers);
81 81
 
82
-		$applicableGroups = array_filter($mount['applicable'], function ($applicable) {
82
+		$applicableGroups = array_filter($mount['applicable'], function($applicable) {
83 83
 			return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_GROUP;
84 84
 		});
85
-		$applicableGroups = array_map(function ($applicable) {
85
+		$applicableGroups = array_map(function($applicable) {
86 86
 			return $applicable['value'];
87 87
 		}, $applicableGroups);
88 88
 
@@ -98,20 +98,20 @@  discard block
 block discarded – undo
98 98
 				$mount['priority']
99 99
 			);
100 100
 			$config->setType($mount['type']);
101
-			$config->setId((int)$mount['mount_id']);
101
+			$config->setId((int) $mount['mount_id']);
102 102
 			return $config;
103 103
 		} catch (\UnexpectedValueException $e) {
104 104
 			// don't die if a storage backend doesn't exist
105 105
 			\OCP\Util::writeLog(
106 106
 				'files_external',
107
-				'Could not load storage: "' . $e->getMessage() . '"',
107
+				'Could not load storage: "'.$e->getMessage().'"',
108 108
 				\OCP\Util::ERROR
109 109
 			);
110 110
 			return null;
111 111
 		} catch (\InvalidArgumentException $e) {
112 112
 			\OCP\Util::writeLog(
113 113
 				'files_external',
114
-				'Could not load storage: "' . $e->getMessage() . '"',
114
+				'Could not load storage: "'.$e->getMessage().'"',
115 115
 				\OCP\Util::ERROR
116 116
 			);
117 117
 			return null;
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
 	protected function readConfig() {
127 127
 		$mounts = $this->readDBConfig();
128 128
 		$configs = array_map([$this, 'getStorageConfigFromDBMount'], $mounts);
129
-		$configs = array_filter($configs, function ($config) {
129
+		$configs = array_filter($configs, function($config) {
130 130
 			return $config instanceof StorageConfig;
131 131
 		});
132 132
 
133
-		$keys = array_map(function (StorageConfig $config) {
133
+		$keys = array_map(function(StorageConfig $config) {
134 134
 			return $config->getId();
135 135
 		}, $configs);
136 136
 
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 		$mount = $this->dbConfig->getMountById($id);
150 150
 
151 151
 		if (!is_array($mount)) {
152
-			throw new NotFoundException('Storage with ID "' . $id . '" not found');
152
+			throw new NotFoundException('Storage with ID "'.$id.'" not found');
153 153
 		}
154 154
 
155 155
 		$config = $this->getStorageConfigFromDBMount($mount);
156 156
 		if ($this->isApplicable($config)) {
157 157
 			return $config;
158 158
 		} else {
159
-			throw new NotFoundException('Storage with ID "' . $id . '" not found');
159
+			throw new NotFoundException('Storage with ID "'.$id.'" not found');
160 160
 		}
161 161
 	}
162 162
 
@@ -379,13 +379,13 @@  discard block
 block discarded – undo
379 379
 		$existingMount = $this->dbConfig->getMountById($id);
380 380
 
381 381
 		if (!is_array($existingMount)) {
382
-			throw new NotFoundException('Storage with ID "' . $id . '" not found while updating storage');
382
+			throw new NotFoundException('Storage with ID "'.$id.'" not found while updating storage');
383 383
 		}
384 384
 
385 385
 		$oldStorage = $this->getStorageConfigFromDBMount($existingMount);
386 386
 
387 387
 		if ($oldStorage->getBackend() instanceof InvalidBackend) {
388
-			throw new NotFoundException('Storage with id "' . $id . '" cannot be edited due to missing backend');
388
+			throw new NotFoundException('Storage with id "'.$id.'" cannot be edited due to missing backend');
389 389
 		}
390 390
 
391 391
 		$removedUsers = array_diff($oldStorage->getApplicableUsers(), $updatedStorage->getApplicableUsers());
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 		$existingMount = $this->dbConfig->getMountById($id);
463 463
 
464 464
 		if (!is_array($existingMount)) {
465
-			throw new NotFoundException('Storage with ID "' . $id . '" not found');
465
+			throw new NotFoundException('Storage with ID "'.$id.'" not found');
466 466
 		}
467 467
 
468 468
 		$this->dbConfig->removeMount($id);
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 			// the storage id could not be computed
481 481
 			\OCP\Util::writeLog(
482 482
 				'files_external',
483
-				'Exception: "' . $e->getMessage() . '"',
483
+				'Exception: "'.$e->getMessage().'"',
484 484
 				\OCP\Util::ERROR
485 485
 			);
486 486
 		}
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/InvalidAuth.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 		$this
38 38
 			->setIdentifier($invalidId)
39 39
 			->setScheme(self::SCHEME_NULL)
40
-			->setText('Unknown auth mechanism backend ' . $invalidId)
40
+			->setText('Unknown auth mechanism backend '.$invalidId)
41 41
 		;
42 42
 	}
43 43
 
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/InvalidBackend.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		$this
47 47
 			->setIdentifier($invalidId)
48 48
 			->setStorageClass('\OC\Files\Storage\FailedStorage')
49
-			->setText('Unknown storage backend ' . $invalidId);
49
+			->setText('Unknown storage backend '.$invalidId);
50 50
 	}
51 51
 
52 52
 	/**
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 		return $this->invalidId;
59 59
 	}
60 60
 
61
-	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
62
-		$storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR));
61
+	public function manipulateStorageConfig(StorageConfig & $storage, IUser $user = null) {
62
+		$storage->setBackendOption('exception', new \Exception('Unknown storage backend "'.$this->invalidId.'"', StorageNotAvailableException::STATUS_ERROR));
63 63
 	}
64 64
 }
65 65
 
Please login to merge, or discard this patch.