Completed
Pull Request — master (#10023)
by Joas
206:15 queued 184:34
created
apps/files_sharing/lib/External/Storage.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		$secure = $protocol === 'https';
79 79
 		$federatedSharingEndpoints = $discoveryService->discover($this->cloudId->getRemote(), 'FEDERATED_SHARING');
80 80
 		$webDavEndpoint = isset($federatedSharingEndpoints['webdav']) ? $federatedSharingEndpoints['webdav'] : '/public.php/webdav';
81
-		$root = rtrim($root, '/') . $webDavEndpoint;
81
+		$root = rtrim($root, '/').$webDavEndpoint;
82 82
 		$this->mountPoint = $options['mountpoint'];
83 83
 		$this->token = $options['token'];
84 84
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			'host' => $host,
88 88
 			'root' => $root,
89 89
 			'user' => $options['token'],
90
-			'password' => (string)$options['password']
90
+			'password' => (string) $options['password']
91 91
 		));
92 92
 	}
93 93
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * @return string
128 128
 	 */
129 129
 	public function getId() {
130
-		return 'shared::' . md5($this->token . '@' . $this->getRemote());
130
+		return 'shared::'.md5($this->token.'@'.$this->getRemote());
131 131
 	}
132 132
 
133 133
 	public function getCache($path = '', $storage = null) {
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	protected function testRemote() {
250 250
 		try {
251
-			return $this->testRemoteUrl($this->getRemote() . '/ocs-provider/index.php')
252
-				|| $this->testRemoteUrl($this->getRemote() . '/ocs-provider/')
253
-				|| $this->testRemoteUrl($this->getRemote() . '/status.php');
251
+			return $this->testRemoteUrl($this->getRemote().'/ocs-provider/index.php')
252
+				|| $this->testRemoteUrl($this->getRemote().'/ocs-provider/')
253
+				|| $this->testRemoteUrl($this->getRemote().'/status.php');
254 254
 		} catch (\Exception $e) {
255 255
 			return false;
256 256
 		}
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
 	 */
263 263
 	private function testRemoteUrl($url) {
264 264
 		$cache = $this->memcacheFactory->createDistributed('files_sharing_remote_url');
265
-		if($cache->hasKey($url)) {
266
-			return (bool)$cache->get($url);
265
+		if ($cache->hasKey($url)) {
266
+			return (bool) $cache->get($url);
267 267
 		}
268 268
 
269 269
 		$client = $this->httpClient->newClient();
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 			$returnValue = false;
281 281
 		}
282 282
 
283
-		$cache->set($url, $returnValue, 60*60*24);
283
+		$cache->set($url, $returnValue, 60 * 60 * 24);
284 284
 		return $returnValue;
285 285
 	}
286 286
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	 * @return bool
292 292
 	 */
293 293
 	public function remoteIsOwnCloud() {
294
-		if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) {
294
+		if (defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote().'/status.php')) {
295 295
 			return false;
296 296
 		}
297 297
 		return true;
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
 		$password = $this->getPassword();
310 310
 
311 311
 		// If remote is not an ownCloud do not try to get any share info
312
-		if(!$this->remoteIsOwnCloud()) {
312
+		if (!$this->remoteIsOwnCloud()) {
313 313
 			return ['status' => 'unsupported'];
314 314
 		}
315 315
 
316
-		$url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token;
316
+		$url = rtrim($remote, '/').'/index.php/apps/files_sharing/shareinfo?t='.$token;
317 317
 
318 318
 		// TODO: DI
319 319
 		$client = \OC::$server->getHTTPClientService()->newClient();
Please login to merge, or discard this patch.
lib/private/Files/ObjectStore/S3Signature.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		$request = $this->prepareRequest($request, $credentials);
46 46
 		$stringToSign = $this->createCanonicalizedString($request);
47 47
 		$auth = 'AWS '
48
-			. $credentials->getAccessKeyId() . ':'
48
+			. $credentials->getAccessKeyId().':'
49 49
 			. $this->signString($stringToSign, $credentials);
50 50
 
51 51
 		return $request->withHeader('Authorization', $auth);
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
 		RequestInterface $request,
131 131
 		$expires = null
132 132
 	) {
133
-		$buffer = $request->getMethod() . "\n";
133
+		$buffer = $request->getMethod()."\n";
134 134
 
135 135
 		// Add the interesting headers
136 136
 		foreach ($this->signableHeaders as $header) {
137
-			$buffer .= $request->getHeaderLine($header) . "\n";
137
+			$buffer .= $request->getHeaderLine($header)."\n";
138 138
 		}
139 139
 
140 140
 		$date = $expires ?: $request->getHeaderLine('date');
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 			if (strpos($name, 'x-amz-') === 0) {
154 154
 				$value = implode(',', $header);
155 155
 				if (strlen($value) > 0) {
156
-					$headers[$name] = $name . ':' . $value;
156
+					$headers[$name] = $name.':'.$value;
157 157
 				}
158 158
 			}
159 159
 		}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
 		ksort($headers);
166 166
 
167
-		return implode("\n", $headers) . "\n";
167
+		return implode("\n", $headers)."\n";
168 168
 	}
169 169
 
170 170
 	private function createCanonicalizedResource(RequestInterface $request)
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		if ($data['bucket']) {
176 176
 			$buffer .= $data['bucket'];
177 177
 			if (!empty($data['key']) || !$data['path_style']) {
178
-				$buffer .= '/' . $data['key'];
178
+				$buffer .= '/'.$data['key'];
179 179
 			}
180 180
 		}
181 181
 
Please login to merge, or discard this patch.
lib/private/DB/QueryBuilder/ExpressionBuilder/SqliteExpressionBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 	 * @inheritdoc
30 30
 	 */
31 31
 	public function like($x, $y, $type = null) {
32
-		return parent::like($x, $y, $type) . " ESCAPE '\\'";
32
+		return parent::like($x, $y, $type)." ESCAPE '\\'";
33 33
 	}
34 34
 
35 35
 	public function iLike($x, $y, $type = null) {
Please login to merge, or discard this patch.
apps/files/lib/Helper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 			'freeSpace' => $storageInfo['free'],
59 59
 			'quota' => $storageInfo['quota'],
60 60
 			'used' => $storageInfo['used'],
61
-			'usedSpacePercent'  => (int)$storageInfo['relative'],
61
+			'usedSpacePercent'  => (int) $storageInfo['relative'],
62 62
 			'owner' => $storageInfo['owner'],
63 63
 			'ownerDisplayName' => $storageInfo['ownerDisplayName'],
64 64
 		];
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @return string icon URL
72 72
 	 */
73 73
 	public static function determineIcon($file) {
74
-		if($file['type'] === 'dir') {
74
+		if ($file['type'] === 'dir') {
75 75
 			$icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir');
76 76
 			// TODO: move this part to the client side, using mountType
77 77
 			if ($file->isShared()) {
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
 			} elseif ($file->isMounted()) {
80 80
 				$icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir-external');
81 81
 			}
82
-		}else{
82
+		} else {
83 83
 			$icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon($file->getMimetype());
84 84
 		}
85 85
 
86
-		return substr($icon, 0, -3) . 'svg';
86
+		return substr($icon, 0, -3).'svg';
87 87
 	}
88 88
 
89 89
 	/**
Please login to merge, or discard this patch.
apps/files_external/lib/Command/Verify.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		try {
72 72
 			$mount = $this->globalService->getStorage($mountId);
73 73
 		} catch (NotFoundException $e) {
74
-			$output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"</error>');
74
+			$output->writeln('<error>Mount with id "'.$mountId.' not found, check "occ files_external:list" to get available mounts"</error>');
75 75
 			return 404;
76 76
 		}
77 77
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
 			foreach ($configInput as $configOption) {
107 107
 				if (!strpos($configOption, '=')) {
108
-					$output->writeln('<error>Invalid mount configuration option "' . $configOption . '"</error>');
108
+					$output->writeln('<error>Invalid mount configuration option "'.$configOption.'"</error>');
109 109
 					return;
110 110
 				}
111 111
 				list($key, $value) = explode('=', $configOption, 2);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 			// FIXME: convert storage exceptions to StorageNotAvailableException
138 138
 			$storage->setStatus(
139 139
 				StorageNotAvailableException::STATUS_ERROR,
140
-				get_class($e) . ': ' . $e->getMessage()
140
+				get_class($e).': '.$e->getMessage()
141 141
 			);
142 142
 		}
143 143
 	}
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/InvalidBackend.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$this
50 50
 			->setIdentifier($invalidId)
51 51
 			->setStorageClass('\OC\Files\Storage\FailedStorage')
52
-			->setText('Unknown storage backend ' . $invalidId);
52
+			->setText('Unknown storage backend '.$invalidId);
53 53
 	}
54 54
 
55 55
 	/**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
65
-		$storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR));
65
+		$storage->setBackendOption('exception', new \Exception('Unknown storage backend "'.$this->invalidId.'"', StorageNotAvailableException::STATUS_ERROR));
66 66
 	}
67 67
 }
68 68
 
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/SMB_OC.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 		$username_as_share = ($storage->getBackendOption('username_as_share') === true);
66 66
 
67 67
 		if ($username_as_share) {
68
-			$share = '/' . $storage->getBackendOption('user');
68
+			$share = '/'.$storage->getBackendOption('user');
69 69
 			$storage->setBackendOption('share', $share);
70 70
 		}
71 71
 	}
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/Password/UserProvided.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	private function getCredentialsIdentifier($storageId) {
64
-		return self::CREDENTIALS_IDENTIFIER_PREFIX . $storageId;
64
+		return self::CREDENTIALS_IDENTIFIER_PREFIX.$storageId;
65 65
 	}
66 66
 
67 67
 	public function saveBackendOptions(IUser $user, $id, array $options) {
Please login to merge, or discard this patch.
apps/files_external/lib/Controller/StoragesController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			$this->logger->logException($e);
128 128
 			return new DataResponse(
129 129
 				[
130
-					'message' => (string)$this->l10n->t('Invalid backend or authentication mechanism class')
130
+					'message' => (string) $this->l10n->t('Invalid backend or authentication mechanism class')
131 131
 				],
132 132
 				Http::STATUS_UNPROCESSABLE_ENTITY
133 133
 			);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		if ($mountPoint === '') {
147 147
 			return new DataResponse(
148 148
 				array(
149
-					'message' => (string)$this->l10n->t('Invalid mount point')
149
+					'message' => (string) $this->l10n->t('Invalid mount point')
150 150
 				),
151 151
 				Http::STATUS_UNPROCESSABLE_ENTITY
152 152
 			);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			// objectstore must not be sent from client side
157 157
 			return new DataResponse(
158 158
 				array(
159
-					'message' => (string)$this->l10n->t('Objectstore forbidden')
159
+					'message' => (string) $this->l10n->t('Objectstore forbidden')
160 160
 				),
161 161
 				Http::STATUS_UNPROCESSABLE_ENTITY
162 162
 			);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 			// invalid backend
171 171
 			return new DataResponse(
172 172
 				array(
173
-					'message' => (string)$this->l10n->t('Invalid storage backend "%s"', [
173
+					'message' => (string) $this->l10n->t('Invalid storage backend "%s"', [
174 174
 						$backend->getIdentifier()
175 175
 					])
176 176
 				),
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 			// not permitted to use backend
183 183
 			return new DataResponse(
184 184
 				array(
185
-					'message' => (string)$this->l10n->t('Not permitted to use backend "%s"', [
185
+					'message' => (string) $this->l10n->t('Not permitted to use backend "%s"', [
186 186
 						$backend->getIdentifier()
187 187
 					])
188 188
 				),
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 			// not permitted to use auth mechanism
194 194
 			return new DataResponse(
195 195
 				array(
196
-					'message' => (string)$this->l10n->t('Not permitted to use authentication mechanism "%s"', [
196
+					'message' => (string) $this->l10n->t('Not permitted to use authentication mechanism "%s"', [
197 197
 						$authMechanism->getIdentifier()
198 198
 					])
199 199
 				),
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 			// unsatisfied parameters
206 206
 			return new DataResponse(
207 207
 				array(
208
-					'message' => (string)$this->l10n->t('Unsatisfied backend parameters')
208
+					'message' => (string) $this->l10n->t('Unsatisfied backend parameters')
209 209
 				),
210 210
 				Http::STATUS_UNPROCESSABLE_ENTITY
211 211
 			);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 			// unsatisfied parameters
215 215
 			return new DataResponse(
216 216
 				[
217
-					'message' => (string)$this->l10n->t('Unsatisfied authentication mechanism parameters')
217
+					'message' => (string) $this->l10n->t('Unsatisfied authentication mechanism parameters')
218 218
 				],
219 219
 				Http::STATUS_UNPROCESSABLE_ENTITY
220 220
 			);
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 		} catch (NotFoundException $e) {
307 307
 			return new DataResponse(
308 308
 				[
309
-					'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
309
+					'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id))
310 310
 				],
311 311
 				Http::STATUS_NOT_FOUND
312 312
 			);
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 		} catch (NotFoundException $e) {
332 332
 			return new DataResponse(
333 333
 				[
334
-					'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
334
+					'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id))
335 335
 				],
336 336
 				Http::STATUS_NOT_FOUND
337 337
 			);
Please login to merge, or discard this patch.