Completed
Pull Request — master (#3614)
by Björn
22:45
created
apps/dav/lib/CardDAV/SyncService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 			if ($ex->getCode() === Http::STATUS_UNAUTHORIZED) {
92 92
 				// remote server revoked access to the address book, remove it
93 93
 				$this->backend->deleteAddressBook($addressBookId);
94
-				$this->logger->info('Authorization failed, remove address book: ' . $url, ['app' => 'dav']);
94
+				$this->logger->info('Authorization failed, remove address book: '.$url, ['app' => 'dav']);
95 95
 				throw $ex;
96 96
 			}
97 97
 		}
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	protected function requestSyncReport($url, $userName, $addressBookUrl, $sharedSecret, $syncToken) {
145 145
 		$settings = [
146
-			'baseUri' => $url . '/',
146
+			'baseUri' => $url.'/',
147 147
 			'userName' => $userName,
148 148
 			'password' => $sharedSecret,
149 149
 		];
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 */
256 256
 	public function deleteUser($userOrCardId) {
257 257
 		$systemAddressBook = $this->getLocalSystemAddressBook();
258
-		if ($userOrCardId instanceof IUser){
258
+		if ($userOrCardId instanceof IUser) {
259 259
 			$name = $userOrCardId->getBackendClassName();
260 260
 			$userId = $userOrCardId->getUID();
261 261
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 		if (is_null($this->localSystemAddressBook)) {
272 272
 			$systemPrincipal = "principals/system/system";
273 273
 			$this->localSystemAddressBook = $this->ensureSystemAddressBookExists($systemPrincipal, 'system', [
274
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => 'System addressbook which holds all users of this instance'
274
+				'{'.Plugin::NS_CARDDAV.'}addressbook-description' => 'System addressbook which holds all users of this instance'
275 275
 			]);
276 276
 		}
277 277
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
 		// remove no longer existing
291 291
 		$allCards = $this->backend->getCards($systemAddressBook['id']);
292
-		foreach($allCards as $card) {
292
+		foreach ($allCards as $card) {
293 293
 			$vCard = Reader::read($card['carddata']);
294 294
 			$uid = $vCard->UID->getValue();
295 295
 			// load backend and see if user exists
Please login to merge, or discard this patch.
apps/federation/lib/BackgroundJob/GetSharedSecret.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
  *
47 47
  * @package OCA\Federation\Backgroundjob
48 48
  */
49
-class GetSharedSecret extends Job{
49
+class GetSharedSecret extends Job {
50 50
 
51 51
 	/** @var IClient */
52 52
 	private $httpClient;
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		$endPoint = isset($endPoints['shared-secret']) ? $endPoints['shared-secret'] : $this->defaultEndPoint;
156 156
 
157 157
 		// make sure that we have a well formated url
158
-		$url = rtrim($target, '/') . '/' . trim($endPoint, '/') . $this->format;
158
+		$url = rtrim($target, '/').'/'.trim($endPoint, '/').$this->format;
159 159
 
160 160
 		$result = null;
161 161
 		try {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		} catch (ClientException $e) {
178 178
 			$status = $e->getCode();
179 179
 			if ($status === Http::STATUS_FORBIDDEN) {
180
-				$this->logger->info($target . ' refused to exchange a shared secret with you.', ['app' => 'federation']);
180
+				$this->logger->info($target.' refused to exchange a shared secret with you.', ['app' => 'federation']);
181 181
 			} else {
182 182
 				$this->logger->logException($e, ['app' => 'federation']);
183 183
 			}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 			&& $status !== Http::STATUS_FORBIDDEN
193 193
 		) {
194 194
 			$this->retainJob = true;
195
-		}  else {
195
+		} else {
196 196
 			// reset token if we received a valid response
197 197
 			$this->dbHandler->addToken($target, '');
198 198
 		}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 				);
208 208
 			} else {
209 209
 				$this->logger->error(
210
-						'remote server "' . $target . '"" does not return a valid shared secret',
210
+						'remote server "'.$target.'"" does not return a valid shared secret',
211 211
 						['app' => 'federation']
212 212
 				);
213 213
 				$this->trustedServers->setServerStatus($target, TrustedServers::STATUS_FAILURE);
Please login to merge, or discard this patch.
apps/federation/lib/BackgroundJob/RequestSharedSecret.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		$endPoint = isset($endPoints['shared-secret']) ? $endPoints['shared-secret'] : $this->defaultEndPoint;
156 156
 
157 157
 		// make sure that we have a well formated url
158
-		$url = rtrim($target, '/') . '/' . trim($endPoint, '/') . $this->format;
158
+		$url = rtrim($target, '/').'/'.trim($endPoint, '/').$this->format;
159 159
 
160 160
 		try {
161 161
 			$result = $this->httpClient->post(
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		} catch (ClientException $e) {
176 176
 			$status = $e->getCode();
177 177
 			if ($status === Http::STATUS_FORBIDDEN) {
178
-				$this->logger->info($target . ' refused to ask for a shared secret.', ['app' => 'federation']);
178
+				$this->logger->info($target.' refused to ask for a shared secret.', ['app' => 'federation']);
179 179
 			} else {
180 180
 				$this->logger->logException($e, ['app' => 'federation']);
181 181
 			}
Please login to merge, or discard this patch.
lib/private/Server.php 1 patch
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 		parent::__construct();
121 121
 		$this->webRoot = $webRoot;
122 122
 
123
-		$this->registerService('ContactsManager', function ($c) {
123
+		$this->registerService('ContactsManager', function($c) {
124 124
 			return new ContactsManager();
125 125
 		});
126 126
 
127
-		$this->registerService('PreviewManager', function (Server $c) {
127
+		$this->registerService('PreviewManager', function(Server $c) {
128 128
 			return new PreviewManager(
129 129
 				$c->getConfig(),
130 130
 				$c->getRootFolder(),
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
 			);
135 135
 		});
136 136
 
137
-		$this->registerService('OCSDiscoveryService', function (Server $c) {
137
+		$this->registerService('OCSDiscoveryService', function(Server $c) {
138 138
 			return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService());
139 139
 ;		});
140 140
 
141
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
141
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
142 142
 			return new \OC\Preview\Watcher(
143 143
 				$c->getAppDataDir('preview')
144 144
 			);
145 145
 		});
146 146
 
147
-		$this->registerService('EncryptionManager', function (Server $c) {
147
+		$this->registerService('EncryptionManager', function(Server $c) {
148 148
 			$view = new View();
149 149
 			$util = new Encryption\Util(
150 150
 				$view,
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 			);
163 163
 		});
164 164
 
165
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
165
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
166 166
 			$util = new Encryption\Util(
167 167
 				new View(),
168 168
 				$c->getUserManager(),
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			return new Encryption\File($util);
173 173
 		});
174 174
 
175
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
175
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
176 176
 			$view = new View();
177 177
 			$util = new Encryption\Util(
178 178
 				$view,
@@ -183,27 +183,27 @@  discard block
 block discarded – undo
183 183
 
184 184
 			return new Encryption\Keys\Storage($view, $util);
185 185
 		});
186
-		$this->registerService('TagMapper', function (Server $c) {
186
+		$this->registerService('TagMapper', function(Server $c) {
187 187
 			return new TagMapper($c->getDatabaseConnection());
188 188
 		});
189
-		$this->registerService('TagManager', function (Server $c) {
189
+		$this->registerService('TagManager', function(Server $c) {
190 190
 			$tagMapper = $c->query('TagMapper');
191 191
 			return new TagManager($tagMapper, $c->getUserSession());
192 192
 		});
193
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
193
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
194 194
 			$config = $c->getConfig();
195 195
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory');
196 196
 			/** @var \OC\SystemTag\ManagerFactory $factory */
197 197
 			$factory = new $factoryClass($this);
198 198
 			return $factory;
199 199
 		});
200
-		$this->registerService('SystemTagManager', function (Server $c) {
200
+		$this->registerService('SystemTagManager', function(Server $c) {
201 201
 			return $c->query('SystemTagManagerFactory')->getManager();
202 202
 		});
203
-		$this->registerService('SystemTagObjectMapper', function (Server $c) {
203
+		$this->registerService('SystemTagObjectMapper', function(Server $c) {
204 204
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
205 205
 		});
206
-		$this->registerService('RootFolder', function (Server $c) {
206
+		$this->registerService('RootFolder', function(Server $c) {
207 207
 			$manager = \OC\Files\Filesystem::getMountManager(null);
208 208
 			$view = new View();
209 209
 			$root = new Root(
@@ -227,28 +227,28 @@  discard block
 block discarded – undo
227 227
 				return $c->query('RootFolder');
228 228
 			});
229 229
 		});
230
-		$this->registerService('UserManager', function (Server $c) {
230
+		$this->registerService('UserManager', function(Server $c) {
231 231
 			$config = $c->getConfig();
232 232
 			return new \OC\User\Manager($config);
233 233
 		});
234
-		$this->registerService('GroupManager', function (Server $c) {
234
+		$this->registerService('GroupManager', function(Server $c) {
235 235
 			$groupManager = new \OC\Group\Manager($this->getUserManager());
236
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
236
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
237 237
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));
238 238
 			});
239
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) {
239
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) {
240 240
 				\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID()));
241 241
 			});
242
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
242
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
243 243
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));
244 244
 			});
245
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
245
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
246 246
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));
247 247
 			});
248
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
248
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
249 249
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));
250 250
 			});
251
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
251
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
252 252
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
253 253
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
254 254
 				\OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
 			return new Store($session, $logger, $tokenProvider);
267 267
 		});
268 268
 		$this->registerAlias(IStore::class, Store::class);
269
-		$this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) {
269
+		$this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) {
270 270
 			$dbConnection = $c->getDatabaseConnection();
271 271
 			return new Authentication\Token\DefaultTokenMapper($dbConnection);
272 272
 		});
273
-		$this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) {
273
+		$this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) {
274 274
 			$mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper');
275 275
 			$crypto = $c->getCrypto();
276 276
 			$config = $c->getConfig();
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 			return new \OC\Authentication\Token\DefaultTokenProvider($mapper, $crypto, $config, $logger, $timeFactory);
280 280
 		});
281 281
 		$this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider');
282
-		$this->registerService('UserSession', function (Server $c) {
282
+		$this->registerService('UserSession', function(Server $c) {
283 283
 			$manager = $c->getUserManager();
284 284
 			$session = new \OC\Session\Memory('');
285 285
 			$timeFactory = new TimeFactory();
@@ -292,69 +292,69 @@  discard block
 block discarded – undo
292 292
 			}
293 293
 
294 294
 			$userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom());
295
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
295
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
296 296
 				\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
297 297
 			});
298
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
298
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
299 299
 				/** @var $user \OC\User\User */
300 300
 				\OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
301 301
 			});
302
-			$userSession->listen('\OC\User', 'preDelete', function ($user) {
302
+			$userSession->listen('\OC\User', 'preDelete', function($user) {
303 303
 				/** @var $user \OC\User\User */
304 304
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
305 305
 			});
306
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
306
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
307 307
 				/** @var $user \OC\User\User */
308 308
 				\OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
309 309
 			});
310
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
310
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
311 311
 				/** @var $user \OC\User\User */
312 312
 				\OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
313 313
 			});
314
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
314
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
315 315
 				/** @var $user \OC\User\User */
316 316
 				\OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
317 317
 			});
318
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
318
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
319 319
 				\OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
320 320
 			});
321
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password) {
321
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password) {
322 322
 				/** @var $user \OC\User\User */
323 323
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
324 324
 			});
325
-			$userSession->listen('\OC\User', 'logout', function () {
325
+			$userSession->listen('\OC\User', 'logout', function() {
326 326
 				\OC_Hook::emit('OC_User', 'logout', array());
327 327
 			});
328
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value) {
328
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value) {
329 329
 				/** @var $user \OC\User\User */
330 330
 				\OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value));
331 331
 			});
332 332
 			return $userSession;
333 333
 		});
334 334
 
335
-		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) {
335
+		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) {
336 336
 			return new \OC\Authentication\TwoFactorAuth\Manager($c->getAppManager(), $c->getSession(), $c->getConfig(), $c->getActivityManager(), $c->getLogger());
337 337
 		});
338 338
 
339
-		$this->registerService('NavigationManager', function (Server $c) {
339
+		$this->registerService('NavigationManager', function(Server $c) {
340 340
 			return new \OC\NavigationManager($c->getAppManager(),
341 341
 				$c->getURLGenerator(),
342 342
 				$c->getL10NFactory(),
343 343
 				$c->getUserSession(),
344 344
 				$c->getGroupManager());
345 345
 		});
346
-		$this->registerService('AllConfig', function (Server $c) {
346
+		$this->registerService('AllConfig', function(Server $c) {
347 347
 			return new \OC\AllConfig(
348 348
 				$c->getSystemConfig()
349 349
 			);
350 350
 		});
351
-		$this->registerService('SystemConfig', function ($c) use ($config) {
351
+		$this->registerService('SystemConfig', function($c) use ($config) {
352 352
 			return new \OC\SystemConfig($config);
353 353
 		});
354
-		$this->registerService('AppConfig', function (Server $c) {
354
+		$this->registerService('AppConfig', function(Server $c) {
355 355
 			return new \OC\AppConfig($c->getDatabaseConnection());
356 356
 		});
357
-		$this->registerService('L10NFactory', function (Server $c) {
357
+		$this->registerService('L10NFactory', function(Server $c) {
358 358
 			return new \OC\L10N\Factory(
359 359
 				$c->getConfig(),
360 360
 				$c->getRequest(),
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 				\OC::$SERVERROOT
363 363
 			);
364 364
 		});
365
-		$this->registerService('URLGenerator', function (Server $c) {
365
+		$this->registerService('URLGenerator', function(Server $c) {
366 366
 			$config = $c->getConfig();
367 367
 			$cacheFactory = $c->getMemCacheFactory();
368 368
 			return new \OC\URLGenerator(
@@ -370,10 +370,10 @@  discard block
 block discarded – undo
370 370
 				$cacheFactory
371 371
 			);
372 372
 		});
373
-		$this->registerService('AppHelper', function ($c) {
373
+		$this->registerService('AppHelper', function($c) {
374 374
 			return new \OC\AppHelper();
375 375
 		});
376
-		$this->registerService('AppFetcher', function ($c) {
376
+		$this->registerService('AppFetcher', function($c) {
377 377
 			return new AppFetcher(
378 378
 				$this->getAppDataDir('appstore'),
379 379
 				$this->getHTTPClientService(),
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 				$this->getConfig()
382 382
 			);
383 383
 		});
384
-		$this->registerService('CategoryFetcher', function ($c) {
384
+		$this->registerService('CategoryFetcher', function($c) {
385 385
 			return new CategoryFetcher(
386 386
 				$this->getAppDataDir('appstore'),
387 387
 				$this->getHTTPClientService(),
@@ -389,19 +389,19 @@  discard block
 block discarded – undo
389 389
 				$this->getConfig()
390 390
 			);
391 391
 		});
392
-		$this->registerService('UserCache', function ($c) {
392
+		$this->registerService('UserCache', function($c) {
393 393
 			return new Cache\File();
394 394
 		});
395
-		$this->registerService('MemCacheFactory', function (Server $c) {
395
+		$this->registerService('MemCacheFactory', function(Server $c) {
396 396
 			$config = $c->getConfig();
397 397
 
398 398
 			if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
399 399
 				$v = \OC_App::getAppVersions();
400
-				$v['core'] = md5(file_get_contents(\OC::$SERVERROOT . '/version.php'));
400
+				$v['core'] = md5(file_get_contents(\OC::$SERVERROOT.'/version.php'));
401 401
 				$version = implode(',', $v);
402 402
 				$instanceId = \OC_Util::getInstanceId();
403 403
 				$path = \OC::$SERVERROOT;
404
-				$prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . \OC::$WEBROOT);
404
+				$prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.\OC::$WEBROOT);
405 405
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
406 406
 					$config->getSystemValue('memcache.local', null),
407 407
 					$config->getSystemValue('memcache.distributed', null),
@@ -415,11 +415,11 @@  discard block
 block discarded – undo
415 415
 				'\\OC\\Memcache\\ArrayCache'
416 416
 			);
417 417
 		});
418
-		$this->registerService('RedisFactory', function (Server $c) {
418
+		$this->registerService('RedisFactory', function(Server $c) {
419 419
 			$systemConfig = $c->getSystemConfig();
420 420
 			return new RedisFactory($systemConfig);
421 421
 		});
422
-		$this->registerService('ActivityManager', function (Server $c) {
422
+		$this->registerService('ActivityManager', function(Server $c) {
423 423
 			return new \OC\Activity\Manager(
424 424
 				$c->getRequest(),
425 425
 				$c->getUserSession(),
@@ -427,13 +427,13 @@  discard block
 block discarded – undo
427 427
 				$c->query(IValidator::class)
428 428
 			);
429 429
 		});
430
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
430
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
431 431
 			return new \OC\Activity\EventMerger(
432 432
 				$c->getL10N('lib')
433 433
 			);
434 434
 		});
435 435
 		$this->registerAlias(IValidator::class, Validator::class);
436
-		$this->registerService('AvatarManager', function (Server $c) {
436
+		$this->registerService('AvatarManager', function(Server $c) {
437 437
 			return new AvatarManager(
438 438
 				$c->getUserManager(),
439 439
 				$c->getAppDataDir('avatar'),
@@ -442,14 +442,14 @@  discard block
 block discarded – undo
442 442
 				$c->getConfig()
443 443
 			);
444 444
 		});
445
-		$this->registerService('Logger', function (Server $c) {
445
+		$this->registerService('Logger', function(Server $c) {
446 446
 			$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file');
447 447
 			$logger = Log::getLogClass($logType);
448 448
 			call_user_func(array($logger, 'init'));
449 449
 
450 450
 			return new Log($logger);
451 451
 		});
452
-		$this->registerService('JobList', function (Server $c) {
452
+		$this->registerService('JobList', function(Server $c) {
453 453
 			$config = $c->getConfig();
454 454
 			return new \OC\BackgroundJob\JobList(
455 455
 				$c->getDatabaseConnection(),
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 				new TimeFactory()
458 458
 			);
459 459
 		});
460
-		$this->registerService('Router', function (Server $c) {
460
+		$this->registerService('Router', function(Server $c) {
461 461
 			$cacheFactory = $c->getMemCacheFactory();
462 462
 			$logger = $c->getLogger();
463 463
 			if ($cacheFactory->isAvailable()) {
@@ -467,22 +467,22 @@  discard block
 block discarded – undo
467 467
 			}
468 468
 			return $router;
469 469
 		});
470
-		$this->registerService('Search', function ($c) {
470
+		$this->registerService('Search', function($c) {
471 471
 			return new Search();
472 472
 		});
473
-		$this->registerService('SecureRandom', function ($c) {
473
+		$this->registerService('SecureRandom', function($c) {
474 474
 			return new SecureRandom();
475 475
 		});
476
-		$this->registerService('Crypto', function (Server $c) {
476
+		$this->registerService('Crypto', function(Server $c) {
477 477
 			return new Crypto($c->getConfig(), $c->getSecureRandom());
478 478
 		});
479
-		$this->registerService('Hasher', function (Server $c) {
479
+		$this->registerService('Hasher', function(Server $c) {
480 480
 			return new Hasher($c->getConfig());
481 481
 		});
482
-		$this->registerService('CredentialsManager', function (Server $c) {
482
+		$this->registerService('CredentialsManager', function(Server $c) {
483 483
 			return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection());
484 484
 		});
485
-		$this->registerService('DatabaseConnection', function (Server $c) {
485
+		$this->registerService('DatabaseConnection', function(Server $c) {
486 486
 			$systemConfig = $c->getSystemConfig();
487 487
 			$factory = new \OC\DB\ConnectionFactory($c->getConfig());
488 488
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -494,14 +494,14 @@  discard block
 block discarded – undo
494 494
 			$connection->getConfiguration()->setSQLLogger($c->getQueryLogger());
495 495
 			return $connection;
496 496
 		});
497
-		$this->registerService('HTTPHelper', function (Server $c) {
497
+		$this->registerService('HTTPHelper', function(Server $c) {
498 498
 			$config = $c->getConfig();
499 499
 			return new HTTPHelper(
500 500
 				$config,
501 501
 				$c->getHTTPClientService()
502 502
 			);
503 503
 		});
504
-		$this->registerService('HttpClientService', function (Server $c) {
504
+		$this->registerService('HttpClientService', function(Server $c) {
505 505
 			$user = \OC_User::getUser();
506 506
 			$uid = $user ? $user : null;
507 507
 			return new ClientService(
@@ -509,27 +509,27 @@  discard block
 block discarded – undo
509 509
 				new \OC\Security\CertificateManager($uid, new View(), $c->getConfig(), $c->getLogger())
510 510
 			);
511 511
 		});
512
-		$this->registerService('EventLogger', function (Server $c) {
512
+		$this->registerService('EventLogger', function(Server $c) {
513 513
 			if ($c->getSystemConfig()->getValue('debug', false)) {
514 514
 				return new EventLogger();
515 515
 			} else {
516 516
 				return new NullEventLogger();
517 517
 			}
518 518
 		});
519
-		$this->registerService('QueryLogger', function (Server $c) {
519
+		$this->registerService('QueryLogger', function(Server $c) {
520 520
 			if ($c->getSystemConfig()->getValue('debug', false)) {
521 521
 				return new QueryLogger();
522 522
 			} else {
523 523
 				return new NullQueryLogger();
524 524
 			}
525 525
 		});
526
-		$this->registerService('TempManager', function (Server $c) {
526
+		$this->registerService('TempManager', function(Server $c) {
527 527
 			return new TempManager(
528 528
 				$c->getLogger(),
529 529
 				$c->getConfig()
530 530
 			);
531 531
 		});
532
-		$this->registerService('AppManager', function (Server $c) {
532
+		$this->registerService('AppManager', function(Server $c) {
533 533
 			return new \OC\App\AppManager(
534 534
 				$c->getUserSession(),
535 535
 				$c->getAppConfig(),
@@ -538,13 +538,13 @@  discard block
 block discarded – undo
538 538
 				$c->getEventDispatcher()
539 539
 			);
540 540
 		});
541
-		$this->registerService('DateTimeZone', function (Server $c) {
541
+		$this->registerService('DateTimeZone', function(Server $c) {
542 542
 			return new DateTimeZone(
543 543
 				$c->getConfig(),
544 544
 				$c->getSession()
545 545
 			);
546 546
 		});
547
-		$this->registerService('DateTimeFormatter', function (Server $c) {
547
+		$this->registerService('DateTimeFormatter', function(Server $c) {
548 548
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
549 549
 
550 550
 			return new DateTimeFormatter(
@@ -552,16 +552,16 @@  discard block
 block discarded – undo
552 552
 				$c->getL10N('lib', $language)
553 553
 			);
554 554
 		});
555
-		$this->registerService('UserMountCache', function (Server $c) {
555
+		$this->registerService('UserMountCache', function(Server $c) {
556 556
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
557 557
 			$listener = new UserMountCacheListener($mountCache);
558 558
 			$listener->listen($c->getUserManager());
559 559
 			return $mountCache;
560 560
 		});
561
-		$this->registerService('MountConfigManager', function (Server $c) {
561
+		$this->registerService('MountConfigManager', function(Server $c) {
562 562
 			$loader = \OC\Files\Filesystem::getLoader();
563 563
 			$mountCache = $c->query('UserMountCache');
564
-			$manager =  new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
564
+			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
565 565
 
566 566
 			// builtin providers
567 567
 
@@ -572,14 +572,14 @@  discard block
 block discarded – undo
572 572
 
573 573
 			return $manager;
574 574
 		});
575
-		$this->registerService('IniWrapper', function ($c) {
575
+		$this->registerService('IniWrapper', function($c) {
576 576
 			return new IniGetWrapper();
577 577
 		});
578
-		$this->registerService('AsyncCommandBus', function (Server $c) {
578
+		$this->registerService('AsyncCommandBus', function(Server $c) {
579 579
 			$jobList = $c->getJobList();
580 580
 			return new AsyncBus($jobList);
581 581
 		});
582
-		$this->registerService('TrustedDomainHelper', function ($c) {
582
+		$this->registerService('TrustedDomainHelper', function($c) {
583 583
 			return new TrustedDomainHelper($this->getConfig());
584 584
 		});
585 585
 		$this->registerService('Throttler', function(Server $c) {
@@ -590,10 +590,10 @@  discard block
 block discarded – undo
590 590
 				$c->getConfig()
591 591
 			);
592 592
 		});
593
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
593
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
594 594
 			// IConfig and IAppManager requires a working database. This code
595 595
 			// might however be called when ownCloud is not yet setup.
596
-			if(\OC::$server->getSystemConfig()->getValue('installed', false)) {
596
+			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
597 597
 				$config = $c->getConfig();
598 598
 				$appManager = $c->getAppManager();
599 599
 			} else {
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 					$c->getTempManager()
612 612
 			);
613 613
 		});
614
-		$this->registerService('Request', function ($c) {
614
+		$this->registerService('Request', function($c) {
615 615
 			if (isset($this['urlParams'])) {
616 616
 				$urlParams = $this['urlParams'];
617 617
 			} else {
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 				$stream
646 646
 			);
647 647
 		});
648
-		$this->registerService('Mailer', function (Server $c) {
648
+		$this->registerService('Mailer', function(Server $c) {
649 649
 			return new Mailer(
650 650
 				$c->getConfig(),
651 651
 				$c->getLogger(),
@@ -655,14 +655,14 @@  discard block
 block discarded – undo
655 655
 		$this->registerService('LDAPProvider', function(Server $c) {
656 656
 			$config = $c->getConfig();
657 657
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
658
-			if(is_null($factoryClass)) {
658
+			if (is_null($factoryClass)) {
659 659
 				throw new \Exception('ldapProviderFactory not set');
660 660
 			}
661 661
 			/** @var \OCP\LDAP\ILDAPProviderFactory $factory */
662 662
 			$factory = new $factoryClass($this);
663 663
 			return $factory->getLDAPProvider();
664 664
 		});
665
-		$this->registerService('LockingProvider', function (Server $c) {
665
+		$this->registerService('LockingProvider', function(Server $c) {
666 666
 			$ini = $c->getIniWrapper();
667 667
 			$config = $c->getConfig();
668 668
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -677,29 +677,29 @@  discard block
 block discarded – undo
677 677
 			}
678 678
 			return new NoopLockingProvider();
679 679
 		});
680
-		$this->registerService('MountManager', function () {
680
+		$this->registerService('MountManager', function() {
681 681
 			return new \OC\Files\Mount\Manager();
682 682
 		});
683
-		$this->registerService('MimeTypeDetector', function (Server $c) {
683
+		$this->registerService('MimeTypeDetector', function(Server $c) {
684 684
 			return new \OC\Files\Type\Detection(
685 685
 				$c->getURLGenerator(),
686 686
 				\OC::$configDir,
687
-				\OC::$SERVERROOT . '/resources/config/'
687
+				\OC::$SERVERROOT.'/resources/config/'
688 688
 			);
689 689
 		});
690
-		$this->registerService('MimeTypeLoader', function (Server $c) {
690
+		$this->registerService('MimeTypeLoader', function(Server $c) {
691 691
 			return new \OC\Files\Type\Loader(
692 692
 				$c->getDatabaseConnection()
693 693
 			);
694 694
 		});
695
-		$this->registerService('NotificationManager', function (Server $c) {
695
+		$this->registerService('NotificationManager', function(Server $c) {
696 696
 			return new Manager(
697 697
 				$c->query(IValidator::class)
698 698
 			);
699 699
 		});
700
-		$this->registerService('CapabilitiesManager', function (Server $c) {
700
+		$this->registerService('CapabilitiesManager', function(Server $c) {
701 701
 			$manager = new \OC\CapabilitiesManager($c->getLogger());
702
-			$manager->registerCapability(function () use ($c) {
702
+			$manager->registerCapability(function() use ($c) {
703 703
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
704 704
 			});
705 705
 			return $manager;
@@ -737,10 +737,10 @@  discard block
 block discarded – undo
737 737
 			}
738 738
 			return new \OC_Defaults();
739 739
 		});
740
-		$this->registerService('EventDispatcher', function () {
740
+		$this->registerService('EventDispatcher', function() {
741 741
 			return new EventDispatcher();
742 742
 		});
743
-		$this->registerService('CryptoWrapper', function (Server $c) {
743
+		$this->registerService('CryptoWrapper', function(Server $c) {
744 744
 			// FIXME: Instantiiated here due to cyclic dependency
745 745
 			$request = new Request(
746 746
 				[
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 				$request
766 766
 			);
767 767
 		});
768
-		$this->registerService('CsrfTokenManager', function (Server $c) {
768
+		$this->registerService('CsrfTokenManager', function(Server $c) {
769 769
 			$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom());
770 770
 
771 771
 			return new CsrfTokenManager(
@@ -773,10 +773,10 @@  discard block
 block discarded – undo
773 773
 				$c->query(SessionStorage::class)
774 774
 			);
775 775
 		});
776
-		$this->registerService(SessionStorage::class, function (Server $c) {
776
+		$this->registerService(SessionStorage::class, function(Server $c) {
777 777
 			return new SessionStorage($c->getSession());
778 778
 		});
779
-		$this->registerService('ContentSecurityPolicyManager', function (Server $c) {
779
+		$this->registerService('ContentSecurityPolicyManager', function(Server $c) {
780 780
 			return new ContentSecurityPolicyManager();
781 781
 		});
782 782
 		$this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) {
@@ -821,23 +821,23 @@  discard block
 block discarded – undo
821 821
 			);
822 822
 			return $manager;
823 823
 		});
824
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
824
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
825 825
 			return new \OC\Files\AppData\Factory(
826 826
 				$c->getRootFolder(),
827 827
 				$c->getSystemConfig()
828 828
 			);
829 829
 		});
830 830
 
831
-		$this->registerService('LockdownManager', function (Server $c) {
831
+		$this->registerService('LockdownManager', function(Server $c) {
832 832
 			return new LockdownManager();
833 833
 		});
834 834
 
835
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
835
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
836 836
 			return new CloudIdManager();
837 837
 		});
838 838
 
839 839
 		/* To trick DI since we don't extend the DIContainer here */
840
-		$this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) {
840
+		$this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) {
841 841
 			return new CleanPreviewsBackgroundJob(
842 842
 				$c->getRootFolder(),
843 843
 				$c->getLogger(),
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 	 * @deprecated since 9.2.0 use IAppData
990 990
 	 */
991 991
 	public function getAppFolder() {
992
-		$dir = '/' . \OC_App::getCurrentApp();
992
+		$dir = '/'.\OC_App::getCurrentApp();
993 993
 		$root = $this->getRootFolder();
994 994
 		if (!$root->nodeExists($dir)) {
995 995
 			$folder = $root->newFolder($dir);
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,6 @@
 block discarded – undo
29 29
 use OC\HintException;
30 30
 use OC\Share\Helper;
31 31
 use OCA\FederatedFileSharing\AddressHandler;
32
-use OCA\FederatedFileSharing\DiscoveryManager;
33 32
 use OCA\FederatedFileSharing\FederatedShareProvider;
34 33
 use OCA\Files_Sharing\External\Manager;
35 34
 use OCP\AppFramework\Controller;
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/Controller/RequestHandlerController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,6 @@
 block discarded – undo
26 26
 
27 27
 namespace OCA\FederatedFileSharing\Controller;
28 28
 
29
-use OCA\FederatedFileSharing\DiscoveryManager;
30 29
 use OCA\Files_Sharing\Activity\Providers\RemoteShares;
31 30
 use OCA\FederatedFileSharing\AddressHandler;
32 31
 use OCA\FederatedFileSharing\FederatedShareProvider;
Please login to merge, or discard this patch.
apps/files_sharing/lib/AppInfo/Application.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@
 block discarded – undo
27 27
 
28 28
 namespace OCA\Files_Sharing\AppInfo;
29 29
 
30
-use OCA\FederatedFileSharing\DiscoveryManager;
31 30
 use OCA\Files_Sharing\Middleware\OCSShareAPIMiddleware;
32 31
 use OCA\Files_Sharing\MountProvider;
33 32
 use OCP\AppFramework\App;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		/**
51 51
 		 * Controllers
52 52
 		 */
53
-		$container->registerService('ShareController', function (SimpleContainer $c) use ($server) {
53
+		$container->registerService('ShareController', function(SimpleContainer $c) use ($server) {
54 54
 			$federatedSharingApp = new \OCA\FederatedFileSharing\AppInfo\Application();
55 55
 			return new ShareController(
56 56
 				$c->query('AppName'),
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 				$server->getThemingDefaults()
71 71
 			);
72 72
 		});
73
-		$container->registerService('ExternalSharesController', function (SimpleContainer $c) {
73
+		$container->registerService('ExternalSharesController', function(SimpleContainer $c) {
74 74
 			return new ExternalSharesController(
75 75
 				$c->query('AppName'),
76 76
 				$c->query('Request'),
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
 		/**
83 83
 		 * Core class wrappers
84 84
 		 */
85
-		$container->registerService('HttpClientService', function (SimpleContainer $c) use ($server) {
85
+		$container->registerService('HttpClientService', function(SimpleContainer $c) use ($server) {
86 86
 			return $server->getHTTPClientService();
87 87
 		});
88
-		$container->registerService(ICloudIdManager::class, function (SimpleContainer $c) use ($server) {
88
+		$container->registerService(ICloudIdManager::class, function(SimpleContainer $c) use ($server) {
89 89
 			return $server->getCloudIdManager();
90 90
 		});
91
-		$container->registerService('ExternalManager', function (SimpleContainer $c) use ($server) {
91
+		$container->registerService('ExternalManager', function(SimpleContainer $c) use ($server) {
92 92
 			$user = $server->getUserSession()->getUser();
93 93
 			$uid = $user ? $user->getUID() : null;
94 94
 			return new \OCA\Files_Sharing\External\Manager(
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		/**
107 107
 		 * Middleware
108 108
 		 */
109
-		$container->registerService('SharingCheckMiddleware', function (SimpleContainer $c) use ($server) {
109
+		$container->registerService('SharingCheckMiddleware', function(SimpleContainer $c) use ($server) {
110 110
 			return new SharingCheckMiddleware(
111 111
 				$c->query('AppName'),
112 112
 				$server->getConfig(),
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 			);
118 118
 		});
119 119
 
120
-		$container->registerService('OCSShareAPIMiddleware', function (SimpleContainer $c) use ($server) {
120
+		$container->registerService('OCSShareAPIMiddleware', function(SimpleContainer $c) use ($server) {
121 121
 			return new OCSShareAPIMiddleware(
122 122
 				$server->getShareManager(),
123 123
 				$server->getL10N($c->query('AppName'))
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		$container->registerMiddleWare('SharingCheckMiddleware');
129 129
 		$container->registerMiddleWare('OCSShareAPIMiddleware');
130 130
 
131
-		$container->registerService('MountProvider', function (IContainer $c) {
131
+		$container->registerService('MountProvider', function(IContainer $c) {
132 132
 			/** @var \OCP\IServerContainer $server */
133 133
 			$server = $c->query('ServerContainer');
134 134
 			return new MountProvider(
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			);
139 139
 		});
140 140
 
141
-		$container->registerService('ExternalMountProvider', function (IContainer $c) {
141
+		$container->registerService('ExternalMountProvider', function(IContainer $c) {
142 142
 			/** @var \OCP\IServerContainer $server */
143 143
 			$server = $c->query('ServerContainer');
144 144
 			return new \OCA\Files_Sharing\External\MountProvider(
Please login to merge, or discard this patch.
apps/files_sharing/lib/External/Manager.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,6 @@
 block discarded – undo
30 30
 namespace OCA\Files_Sharing\External;
31 31
 
32 32
 use OC\Files\Filesystem;
33
-use OCA\FederatedFileSharing\DiscoveryManager;
34 33
 use OCP\Files;
35 34
 use OCP\Files\Storage\IStorageFactory;
36 35
 use OCP\Http\Client\IClientService;
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 	 * @param int $remoteId
115 115
 	 * @return Mount|null
116 116
 	 */
117
-	public function addShare($remote, $token, $password, $name, $owner, $accepted=false, $user = null, $remoteId = -1) {
117
+	public function addShare($remote, $token, $password, $name, $owner, $accepted = false, $user = null, $remoteId = -1) {
118 118
 
119 119
 		$user = $user ? $user : $this->uid;
120 120
 		$accepted = $accepted ? 1 : 0;
121
-		$name = Filesystem::normalizePath('/' . $name);
121
+		$name = Filesystem::normalizePath('/'.$name);
122 122
 
123 123
 		if (!$accepted) {
124 124
 			// To avoid conflicts with the mount point generation later,
125 125
 			// we only use a temporary mount point name here. The real
126 126
 			// mount point name will be generated when accepting the share,
127 127
 			// using the original share item name.
128
-			$tmpMountPointName = '{{TemporaryMountPointName#' . $name . '}}';
128
+			$tmpMountPointName = '{{TemporaryMountPointName#'.$name.'}}';
129 129
 			$mountPoint = $tmpMountPointName;
130 130
 			$hash = md5($tmpMountPointName);
131 131
 			$data = [
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			$i = 1;
145 145
 			while (!$this->connection->insertIfNotExist('*PREFIX*share_external', $data, ['user', 'mountpoint_hash'])) {
146 146
 				// The external share already exists for the user
147
-				$data['mountpoint'] = $tmpMountPointName . '-' . $i;
147
+				$data['mountpoint'] = $tmpMountPointName.'-'.$i;
148 148
 				$data['mountpoint_hash'] = md5($data['mountpoint']);
149 149
 				$i++;
150 150
 			}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 		}
153 153
 
154 154
 		$mountPoint = Files::buildNotExistingFileName('/', $name);
155
-		$mountPoint = Filesystem::normalizePath('/' . $mountPoint);
155
+		$mountPoint = Filesystem::normalizePath('/'.$mountPoint);
156 156
 		$hash = md5($mountPoint);
157 157
 
158 158
 		$query = $this->connection->prepare('
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
 		if ($share) {
202 202
 			$mountPoint = Files::buildNotExistingFileName('/', $share['name']);
203
-			$mountPoint = Filesystem::normalizePath('/' . $mountPoint);
203
+			$mountPoint = Filesystem::normalizePath('/'.$mountPoint);
204 204
 			$hash = md5($mountPoint);
205 205
 
206 206
 			$acceptShare = $this->connection->prepare('
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 		$federationEndpoints = $this->discoveryService->discover($remote, 'FEDERATED_SHARING');
270 270
 		$endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares';
271 271
 
272
-		$url = rtrim($remote, '/') . $endpoint . '/' . $remoteId . '/' . $feedback . '?format=' . \OCP\Share::RESPONSE_FORMAT;
272
+		$url = rtrim($remote, '/').$endpoint.'/'.$remoteId.'/'.$feedback.'?format='.\OCP\Share::RESPONSE_FORMAT;
273 273
 		$fields = array('token' => $token);
274 274
 
275 275
 		$client = $this->clientService->newClient();
@@ -298,13 +298,13 @@  discard block
 block discarded – undo
298 298
 	 * @return string
299 299
 	 */
300 300
 	protected function stripPath($path) {
301
-		$prefix = '/' . $this->uid . '/files';
301
+		$prefix = '/'.$this->uid.'/files';
302 302
 		return rtrim(substr($path, strlen($prefix)), '/');
303 303
 	}
304 304
 
305 305
 	public function getMount($data) {
306 306
 		$data['manager'] = $this;
307
-		$mountPoint = '/' . $this->uid . '/files' . $data['mountpoint'];
307
+		$mountPoint = '/'.$this->uid.'/files'.$data['mountpoint'];
308 308
 		$data['mountpoint'] = $mountPoint;
309 309
 		$data['certificateManager'] = \OC::$server->getCertificateManager($this->uid);
310 310
 		return new Mount(self::STORAGE, $mountPoint, $data, $this, $this->storageLoader);
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 			WHERE `mountpoint_hash` = ?
345 345
 			AND `user` = ?
346 346
 		');
347
-		$result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $this->uid));
347
+		$result = (bool) $query->execute(array($target, $targetHash, $sourceHash, $this->uid));
348 348
 
349 349
 		return $result;
350 350
 	}
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
 			WHERE `mountpoint_hash` = ?
375 375
 			AND `user` = ?
376 376
 		');
377
-		$result = (bool)$query->execute(array($hash, $this->uid));
377
+		$result = (bool) $query->execute(array($hash, $this->uid));
378 378
 
379
-		if($result) {
379
+		if ($result) {
380 380
 			$this->removeReShares($id);
381 381
 		}
382 382
 
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 
398 398
 
399 399
 		$query->delete('federated_reshares')
400
-			->where($query->expr()->in('share_id', $query->createFunction('(' . $select . ')')));
400
+			->where($query->expr()->in('share_id', $query->createFunction('('.$select.')')));
401 401
 		$query->execute();
402 402
 
403 403
 		$deleteReShares = $this->connection->getQueryBuilder();
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 
422 422
 		if ($result) {
423 423
 			$shares = $getShare->fetchAll();
424
-			foreach($shares as $share) {
424
+			foreach ($shares as $share) {
425 425
 				$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline');
426 426
 			}
427 427
 		}
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 			DELETE FROM `*PREFIX*share_external`
431 431
 			WHERE `user` = ?
432 432
 		');
433
-		return (bool)$query->execute(array($uid));
433
+		return (bool) $query->execute(array($uid));
434 434
 	}
435 435
 
436 436
 	/**
Please login to merge, or discard this patch.
apps/files_sharing/lib/External/Storage.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,6 @@
 block discarded – undo
32 32
 use GuzzleHttp\Exception\ConnectException;
33 33
 use OC\Files\Storage\DAV;
34 34
 use OC\ForbiddenException;
35
-use OCA\FederatedFileSharing\DiscoveryManager;
36 35
 use OCA\Files_Sharing\ISharedStorage;
37 36
 use OCP\AppFramework\Http;
38 37
 use OCP\Federation\ICloudId;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$secure = $protocol === 'https';
78 78
 		$federatedSharingEndpoints = $discoveryService->discover($this->cloudId->getRemote(), 'FEDERATED_SHARING');
79 79
 		$webDavEndpoint = isset($federatedSharingEndpoints['webdav']) ? $federatedSharingEndpoints['webdav'] : '/public.php/webdav';
80
-		$root = rtrim($root, '/') . $webDavEndpoint;
80
+		$root = rtrim($root, '/').$webDavEndpoint;
81 81
 		$this->mountPoint = $options['mountpoint'];
82 82
 		$this->token = $options['token'];
83 83
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			'host' => $host,
87 87
 			'root' => $root,
88 88
 			'user' => $options['token'],
89
-			'password' => (string)$options['password']
89
+			'password' => (string) $options['password']
90 90
 		));
91 91
 	}
92 92
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * @return string
127 127
 	 */
128 128
 	public function getId() {
129
-		return 'shared::' . md5($this->token . '@' . $this->getRemote());
129
+		return 'shared::'.md5($this->token.'@'.$this->getRemote());
130 130
 	}
131 131
 
132 132
 	public function getCache($path = '', $storage = null) {
@@ -247,9 +247,9 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	protected function testRemote() {
249 249
 		try {
250
-			return $this->testRemoteUrl($this->getRemote() . '/ocs-provider/index.php')
251
-				|| $this->testRemoteUrl($this->getRemote() . '/ocs-provider/')
252
-				|| $this->testRemoteUrl($this->getRemote() . '/status.php');
250
+			return $this->testRemoteUrl($this->getRemote().'/ocs-provider/index.php')
251
+				|| $this->testRemoteUrl($this->getRemote().'/ocs-provider/')
252
+				|| $this->testRemoteUrl($this->getRemote().'/status.php');
253 253
 		} catch (\Exception $e) {
254 254
 			return false;
255 255
 		}
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	private function testRemoteUrl($url) {
263 263
 		$cache = $this->memcacheFactory->create('files_sharing_remote_url');
264
-		if($cache->hasKey($url)) {
265
-			return (bool)$cache->get($url);
264
+		if ($cache->hasKey($url)) {
265
+			return (bool) $cache->get($url);
266 266
 		}
267 267
 
268 268
 		$client = $this->httpClient->newClient();
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	 * @return bool
291 291
 	 */
292 292
 	public function remoteIsOwnCloud() {
293
-		if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) {
293
+		if (defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote().'/status.php')) {
294 294
 			return false;
295 295
 		}
296 296
 		return true;
@@ -308,11 +308,11 @@  discard block
 block discarded – undo
308 308
 		$password = $this->getPassword();
309 309
 
310 310
 		// If remote is not an ownCloud do not try to get any share info
311
-		if(!$this->remoteIsOwnCloud()) {
311
+		if (!$this->remoteIsOwnCloud()) {
312 312
 			return ['status' => 'unsupported'];
313 313
 		}
314 314
 
315
-		$url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token;
315
+		$url = rtrim($remote, '/').'/index.php/apps/files_sharing/shareinfo?t='.$token;
316 316
 
317 317
 		// TODO: DI
318 318
 		$client = \OC::$server->getHTTPClientService()->newClient();
Please login to merge, or discard this patch.