Completed
Pull Request — master (#9345)
by Björn
163:05 queued 139:41
created
apps/federatedfilesharing/lib/FederatedShareProvider.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		if ($remoteShare) {
193 193
 			try {
194 194
 				$ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']);
195
-				$shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time());
195
+				$shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_'.time());
196 196
 				$share->setId($shareId);
197 197
 				list($token, $remoteId) = $this->askOwnerToReShare($shareWith, $share, $shareId);
198 198
 				// remote share was create successfully if we get a valid token as return
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 			$failure = true;
273 273
 		}
274 274
 
275
-		if($failure) {
275
+		if ($failure) {
276 276
 			$this->removeShareFromTableById($shareId);
277 277
 			$message_t = $this->l->t('Sharing %s failed, could not find %s, maybe the server is currently unreachable or uses a self-signed certificate.',
278 278
 				[$share->getNode()->getName(), $share->getSharedWith()]);
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 			->andWhere($query->expr()->eq('mountpoint', $query->createNamedParameter($share->getTarget())));
325 325
 		$result = $query->execute()->fetchAll();
326 326
 
327
-		if (isset($result[0]) && (int)$result[0]['remote_id'] > 0) {
327
+		if (isset($result[0]) && (int) $result[0]['remote_id'] > 0) {
328 328
 			return $result[0];
329 329
 		}
330 330
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 		$qb->execute();
367 367
 		$id = $qb->getLastInsertId();
368 368
 
369
-		return (int)$id;
369
+		return (int) $id;
370 370
 	}
371 371
 
372 372
 	/**
@@ -456,14 +456,14 @@  discard block
 block discarded – undo
456 456
 	public function getRemoteId(IShare $share) {
457 457
 		$query = $this->dbConnection->getQueryBuilder();
458 458
 		$query->select('remote_id')->from('federated_reshares')
459
-			->where($query->expr()->eq('share_id', $query->createNamedParameter((int)$share->getId())));
459
+			->where($query->expr()->eq('share_id', $query->createNamedParameter((int) $share->getId())));
460 460
 		$data = $query->execute()->fetch();
461 461
 
462 462
 		if (!is_array($data) || !isset($data['remote_id'])) {
463 463
 			throw new ShareNotFound();
464 464
 		}
465 465
 
466
-		return (int)$data['remote_id'];
466
+		return (int) $data['remote_id'];
467 467
 	}
468 468
 
469 469
 	/**
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 			->orderBy('id');
495 495
 
496 496
 		$cursor = $qb->execute();
497
-		while($data = $cursor->fetch()) {
497
+		while ($data = $cursor->fetch()) {
498 498
 			$children[] = $this->createShareObject($data);
499 499
 		}
500 500
 		$cursor->closeCursor();
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 			);
613 613
 		}
614 614
 
615
-		$qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
615
+		$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
616 616
 		$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
617 617
 
618 618
 		$qb->orderBy('id');
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 
676 676
 		$cursor = $qb->execute();
677 677
 		$shares = [];
678
-		while($data = $cursor->fetch()) {
678
+		while ($data = $cursor->fetch()) {
679 679
 			$shares[] = $this->createShareObject($data);
680 680
 		}
681 681
 		$cursor->closeCursor();
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 		$cursor->closeCursor();
700 700
 
701 701
 		if ($data === false) {
702
-			throw new ShareNotFound('Can not find share with ID: ' . $id);
702
+			throw new ShareNotFound('Can not find share with ID: '.$id);
703 703
 		}
704 704
 
705 705
 		try {
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 			->execute();
728 728
 
729 729
 		$shares = [];
730
-		while($data = $cursor->fetch()) {
730
+		while ($data = $cursor->fetch()) {
731 731
 			$shares[] = $this->createShareObject($data);
732 732
 		}
733 733
 		$cursor->closeCursor();
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 
767 767
 		$cursor = $qb->execute();
768 768
 
769
-		while($data = $cursor->fetch()) {
769
+		while ($data = $cursor->fetch()) {
770 770
 			$shares[] = $this->createShareObject($data);
771 771
 		}
772 772
 		$cursor->closeCursor();
@@ -843,15 +843,15 @@  discard block
 block discarded – undo
843 843
 	private function createShareObject($data) {
844 844
 
845 845
 		$share = new Share($this->rootFolder, $this->userManager);
846
-		$share->setId((int)$data['id'])
847
-			->setShareType((int)$data['share_type'])
848
-			->setPermissions((int)$data['permissions'])
846
+		$share->setId((int) $data['id'])
847
+			->setShareType((int) $data['share_type'])
848
+			->setPermissions((int) $data['permissions'])
849 849
 			->setTarget($data['file_target'])
850
-			->setMailSend((bool)$data['mail_send'])
850
+			->setMailSend((bool) $data['mail_send'])
851 851
 			->setToken($data['token']);
852 852
 
853 853
 		$shareTime = new \DateTime();
854
-		$shareTime->setTimestamp((int)$data['stime']);
854
+		$shareTime->setTimestamp((int) $data['stime']);
855 855
 		$share->setShareTime($shareTime);
856 856
 		$share->setSharedWith($data['share_with']);
857 857
 
@@ -861,13 +861,13 @@  discard block
 block discarded – undo
861 861
 		} else {
862 862
 			//OLD SHARE
863 863
 			$share->setSharedBy($data['uid_owner']);
864
-			$path = $this->getNode($share->getSharedBy(), (int)$data['file_source']);
864
+			$path = $this->getNode($share->getSharedBy(), (int) $data['file_source']);
865 865
 
866 866
 			$owner = $path->getOwner();
867 867
 			$share->setShareOwner($owner->getUID());
868 868
 		}
869 869
 
870
-		$share->setNodeId((int)$data['file_source']);
870
+		$share->setNodeId((int) $data['file_source']);
871 871
 		$share->setNodeType($data['item_type']);
872 872
 
873 873
 		$share->setProviderId($this->identifier());
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/Controller/RequestHandlerController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		$owner = isset($_POST['owner']) ? $_POST['owner'] : null;
146 146
 		$sharedBy = isset($_POST['sharedBy']) ? $_POST['sharedBy'] : null;
147 147
 		$shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null;
148
-		$remoteId = isset($_POST['remoteId']) ? (int)$_POST['remoteId'] : null;
148
+		$remoteId = isset($_POST['remoteId']) ? (int) $_POST['remoteId'] : null;
149 149
 		$sharedByFederatedId = isset($_POST['sharedByFederatedId']) ? $_POST['sharedByFederatedId'] : null;
150 150
 		$ownerFederatedId = isset($_POST['ownerFederatedId']) ? $_POST['ownerFederatedId'] : null;
151 151
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		} catch (ProviderCouldNotAddShareException $e) {
181 181
 			throw new OCSException($e->getMessage(), 400);
182 182
 		} catch (\Exception $e) {
183
-			throw new OCSException('internal server error, was not able to add share from ' . $remote, 500);
183
+			throw new OCSException('internal server error, was not able to add share from '.$remote, 500);
184 184
 		}
185 185
 
186 186
 		return new Http\DataResponse();
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
 
203 203
 		$token = $this->request->getParam('token', null);
204 204
 		$shareWith = $this->request->getParam('shareWith', null);
205
-		$permission = (int)$this->request->getParam('permission', null);
206
-		$remoteId = (int)$this->request->getParam('remoteId', null);
205
+		$permission = (int) $this->request->getParam('permission', null);
206
+		$remoteId = (int) $this->request->getParam('remoteId', null);
207 207
 
208 208
 		if ($id === null ||
209 209
 			$token === null ||
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
 		} catch (ProviderDoesNotExistsException $e) {
232 232
 			throw new OCSException('Server does not support federated cloud sharing', 503);
233 233
 		} catch (ShareNotFound $e) {
234
-			$this->logger->debug('Share not found: ' . $e->getMessage());
234
+			$this->logger->debug('Share not found: '.$e->getMessage());
235 235
 		} catch (\Exception $e) {
236
-			$this->logger->debug('internal server error, can not process notification: ' . $e->getMessage());
236
+			$this->logger->debug('internal server error, can not process notification: '.$e->getMessage());
237 237
 		}
238 238
 
239 239
 		throw new OCSBadRequestException();
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
 		} catch (ProviderDoesNotExistsException $e) {
268 268
 			throw new OCSException('Server does not support federated cloud sharing', 503);
269 269
 		} catch (ShareNotFound $e) {
270
-			$this->logger->debug('Share not found: ' . $e->getMessage());
270
+			$this->logger->debug('Share not found: '.$e->getMessage());
271 271
 		} catch (\Exception $e) {
272
-			$this->logger->debug('internal server error, can not process notification: ' . $e->getMessage());
272
+			$this->logger->debug('internal server error, can not process notification: '.$e->getMessage());
273 273
 		}
274 274
 
275 275
 		return new Http\DataResponse();
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
 		} catch (ProviderDoesNotExistsException $e) {
301 301
 			throw new OCSException('Server does not support federated cloud sharing', 503);
302 302
 		} catch (ShareNotFound $e) {
303
-			$this->logger->debug('Share not found: ' . $e->getMessage());
303
+			$this->logger->debug('Share not found: '.$e->getMessage());
304 304
 		} catch (\Exception $e) {
305
-			$this->logger->debug('internal server error, can not process notification: ' . $e->getMessage());
305
+			$this->logger->debug('internal server error, can not process notification: '.$e->getMessage());
306 306
 		}
307 307
 
308 308
 		return new Http\DataResponse();
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 			$notification = ['sharedSecret' => $token];
332 332
 			$provider->notificationReceived('SHARE_UNSHARED', $id, $notification);
333 333
 		} catch (\Exception $e) {
334
-			$this->logger->debug('processing unshare notification failed: ' . $e->getMessage());
334
+			$this->logger->debug('processing unshare notification failed: '.$e->getMessage());
335 335
 		}
336 336
 
337 337
 		return new Http\DataResponse();
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 
405 405
 		try {
406 406
 			$provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file');
407
-			$ocmPermissions = $this->ncPermissions2ocmPermissions((int)$ncPermissions);
407
+			$ocmPermissions = $this->ncPermissions2ocmPermissions((int) $ncPermissions);
408 408
 			$notification = ['sharedSecret' => $token, 'permission' => $ocmPermissions];
409 409
 			$provider->notificationReceived('RESHARE_CHANGE_PERMISSION', $id, $notification);
410 410
 		} catch (\Exception $e) {
Please login to merge, or discard this patch.
apps/cloud_federation_api/lib/Controller/RequestHandlerController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 		if (!$this->userManager->userExists($shareWith)) {
151 151
 			return new JSONResponse(
152
-				['message' => 'User "' . $shareWith . '" does not exists at ' . $this->urlGenerator->getBaseUrl()],
152
+				['message' => 'User "'.$shareWith.'" does not exists at '.$this->urlGenerator->getBaseUrl()],
153 153
 				Http::STATUS_BAD_REQUEST
154 154
 			);
155 155
 		}
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
 			);
182 182
 		} catch (\Exception $e) {
183 183
 			return new JSONResponse(
184
-				['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()],
184
+				['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()],
185 185
 				Http::STATUS_BAD_REQUEST
186 186
 			);
187 187
 		}
188 188
 
189 189
 		$user = $this->userManager->get($shareWithLocalId);
190 190
 		$recipientDisplayName = '';
191
-		if($user) {
191
+		if ($user) {
192 192
 			$recipientDisplayName = $user->getDisplayName();
193 193
 		}
194 194
 
@@ -256,12 +256,12 @@  discard block
 block discarded – undo
256 256
 		}
257 257
 		catch (\Exception $e) {
258 258
 			return new JSONResponse(
259
-				['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()],
259
+				['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()],
260 260
 				Http::STATUS_BAD_REQUEST
261 261
 			);
262 262
 		}
263 263
 
264
-		return new JSONResponse($result,Http::STATUS_CREATED);
264
+		return new JSONResponse($result, Http::STATUS_CREATED);
265 265
 
266 266
 	}
267 267
 
@@ -274,13 +274,13 @@  discard block
 block discarded – undo
274 274
 	private function mapUid($uid) {
275 275
 		\OC::$server->getURLGenerator()->linkToDocs('key');
276 276
 		// FIXME this should be a method in the user management instead
277
-		$this->logger->debug('shareWith before, ' . $uid, ['app' => $this->appName]);
277
+		$this->logger->debug('shareWith before, '.$uid, ['app' => $this->appName]);
278 278
 		\OCP\Util::emitHook(
279 279
 			'\OCA\Files_Sharing\API\Server2Server',
280 280
 			'preLoginNameUsedAsUserName',
281 281
 			array('uid' => &$uid)
282 282
 		);
283
-		$this->logger->debug('shareWith after, ' . $uid, ['app' => $this->appName]);
283
+		$this->logger->debug('shareWith after, '.$uid, ['app' => $this->appName]);
284 284
 
285 285
 		return $uid;
286 286
 	}
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		// for backward compatibility make sure that the remote url stored in the
165 165
 		// database ends with a trailing slash
166 166
 		if (substr($remote, -1) !== '/') {
167
-			$remote = $remote . '/';
167
+			$remote = $remote.'/';
168 168
 		}
169 169
 
170 170
 		$token = $share->getShareSecret();
@@ -190,16 +190,16 @@  discard block
 block discarded – undo
190 190
 			}
191 191
 
192 192
 			// FIXME this should be a method in the user management instead
193
-			$this->logger->debug('shareWith before, ' . $shareWith, ['app' => 'files_sharing']);
193
+			$this->logger->debug('shareWith before, '.$shareWith, ['app' => 'files_sharing']);
194 194
 			Util::emitHook(
195 195
 				'\OCA\Files_Sharing\API\Server2Server',
196 196
 				'preLoginNameUsedAsUserName',
197 197
 				array('uid' => &$shareWith)
198 198
 			);
199
-			$this->logger->debug('shareWith after, ' . $shareWith, ['app' => 'files_sharing']);
199
+			$this->logger->debug('shareWith after, '.$shareWith, ['app' => 'files_sharing']);
200 200
 
201 201
 			if (!$this->userManager->userExists($shareWith)) {
202
-				throw new ProviderCouldNotAddShareException('User does not exists', '',Http::STATUS_BAD_REQUEST);
202
+				throw new ProviderCouldNotAddShareException('User does not exists', '', Http::STATUS_BAD_REQUEST);
203 203
 			}
204 204
 
205 205
 			\OC_Util::setupFS($shareWith);
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 					->setType('remote_share')
226 226
 					->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')])
227 227
 					->setAffectedUser($shareWith)
228
-					->setObject('remote_share', (int)$shareId, $name);
228
+					->setObject('remote_share', (int) $shareId, $name);
229 229
 				\OC::$server->getActivityManager()->publish($event);
230 230
 
231 231
 				$notification = $this->notificationManager->createNotification();
@@ -237,12 +237,12 @@  discard block
 block discarded – undo
237 237
 
238 238
 				$declineAction = $notification->createAction();
239 239
 				$declineAction->setLabel('decline')
240
-					->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'DELETE');
240
+					->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'DELETE');
241 241
 				$notification->addAction($declineAction);
242 242
 
243 243
 				$acceptAction = $notification->createAction();
244 244
 				$acceptAction->setLabel('accept')
245
-					->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'POST');
245
+					->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'POST');
246 246
 				$notification->addAction($acceptAction);
247 247
 
248 248
 				$this->notificationManager->notify($notification);
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 					'level' => ILogger::ERROR,
255 255
 					'app' => 'files_sharing'
256 256
 				]);
257
-				throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from ' . $remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR);
257
+				throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from '.$remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR);
258 258
 			}
259 259
 		}
260 260
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 	 */
352 352
 	protected function executeAcceptShare(IShare $share) {
353 353
 		try {
354
-			$fileId = (int)$share->getNode()->getId();
354
+			$fileId = (int) $share->getNode()->getId();
355 355
 			list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId);
356 356
 		} catch (\Exception $e) {
357 357
 			throw new ShareNotFound();
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 		$this->federatedShareProvider->removeShareFromTable($share);
430 430
 
431 431
 		try {
432
-			$fileId = (int)$share->getNode()->getId();
432
+			$fileId = (int) $share->getNode()->getId();
433 433
 			list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId);
434 434
 		} catch (\Exception $e) {
435 435
 			throw new ShareNotFound();
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 			$notification = $this->notificationManager->createNotification();
531 531
 			$notification->setApp('files_sharing')
532 532
 				->setUser($share['user'])
533
-				->setObject('remote_share', (int)$share['id']);
533
+				->setObject('remote_share', (int) $share['id']);
534 534
 			$this->notificationManager->markProcessed($notification);
535 535
 
536 536
 			$event = $this->activityManager->generateEvent();
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 				->setType('remote_share')
539 539
 				->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_UNSHARED, [$owner->getId(), $path])
540 540
 				->setAffectedUser($user)
541
-				->setObject('remote_share', (int)$share['id'], $path);
541
+				->setObject('remote_share', (int) $share['id'], $path);
542 542
 			\OC::$server->getActivityManager()->publish($event);
543 543
 		}
544 544
 
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
 			$owner = $share->getShareOwner();
587 587
 			$currentServer = $this->addressHandler->generateRemoteURL();
588 588
 			if ($this->addressHandler->compareAddresses($user, $remote, $owner, $currentServer)) {
589
-				throw new ProviderCouldNotAddShareException('Resharing back to the owner is not allowed: ' . $id);
589
+				throw new ProviderCouldNotAddShareException('Resharing back to the owner is not allowed: '.$id);
590 590
 			}
591 591
 		} catch (\Exception $e) {
592 592
 			throw new ProviderCouldNotAddShareException($e->getMessage());
@@ -600,10 +600,10 @@  discard block
 block discarded – undo
600 600
 			$share->setSharedBy($share->getSharedWith());
601 601
 			$share->setSharedWith($shareWith);
602 602
 			$result = $this->federatedShareProvider->create($share);
603
-			$this->federatedShareProvider->storeRemoteId((int)$result->getId(), $senderId);
603
+			$this->federatedShareProvider->storeRemoteId((int) $result->getId(), $senderId);
604 604
 			return ['token' => $result->getToken(), 'providerId' => $result->getId()];
605 605
 		} else {
606
-			throw new ProviderCouldNotAddShareException('resharing not allowed for share: ' . $id);
606
+			throw new ProviderCouldNotAddShareException('resharing not allowed for share: '.$id);
607 607
 		}
608 608
 
609 609
 	}
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 	 */
650 650
 	protected function ocmPermissions2ncPermissions(array $ocmPermissions) {
651 651
 		$ncPermissions = 0;
652
-		foreach($ocmPermissions as $permission) {
652
+		foreach ($ocmPermissions as $permission) {
653 653
 			switch (strtolower($permission)) {
654 654
 				case 'read':
655 655
 					$ncPermissions += Constants::PERMISSION_READ;
Please login to merge, or discard this patch.
apps/files_sharing/lib/External/Storage.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 		$secure = $protocol === 'https';
80 80
 		$federatedSharingEndpoints = $discoveryService->discover($this->cloudId->getRemote(), 'FEDERATED_SHARING');
81 81
 		$webDavEndpoint = isset($federatedSharingEndpoints['webdav']) ? $federatedSharingEndpoints['webdav'] : '/public.php/webdav';
82
-		$root = rtrim($root, '/') . $webDavEndpoint;
82
+		$root = rtrim($root, '/').$webDavEndpoint;
83 83
 		$this->mountPoint = $options['mountpoint'];
84 84
 		$this->token = $options['token'];
85 85
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 			'host' => $host,
89 89
 			'root' => $root,
90 90
 			'user' => $options['token'],
91
-			'password' => (string)$options['password']
91
+			'password' => (string) $options['password']
92 92
 		));
93 93
 	}
94 94
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @return string
129 129
 	 */
130 130
 	public function getId() {
131
-		return 'shared::' . md5($this->token . '@' . $this->getRemote());
131
+		return 'shared::'.md5($this->token.'@'.$this->getRemote());
132 132
 	}
133 133
 
134 134
 	public function getCache($path = '', $storage = null) {
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
 	 */
250 250
 	protected function testRemote() {
251 251
 		try {
252
-			return $this->testRemoteUrl($this->getRemote() . '/ocs-provider/index.php')
253
-				|| $this->testRemoteUrl($this->getRemote() . '/ocs-provider/')
254
-				|| $this->testRemoteUrl($this->getRemote() . '/status.php');
252
+			return $this->testRemoteUrl($this->getRemote().'/ocs-provider/index.php')
253
+				|| $this->testRemoteUrl($this->getRemote().'/ocs-provider/')
254
+				|| $this->testRemoteUrl($this->getRemote().'/status.php');
255 255
 		} catch (\Exception $e) {
256 256
 			return false;
257 257
 		}
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	private function testRemoteUrl($url) {
265 265
 		$cache = $this->memcacheFactory->createDistributed('files_sharing_remote_url');
266
-		if($cache->hasKey($url)) {
267
-			return (bool)$cache->get($url);
266
+		if ($cache->hasKey($url)) {
267
+			return (bool) $cache->get($url);
268 268
 		}
269 269
 
270 270
 		$client = $this->httpClient->newClient();
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 			$returnValue = false;
282 282
 		}
283 283
 
284
-		$cache->set($url, $returnValue, 60*60*24);
284
+		$cache->set($url, $returnValue, 60 * 60 * 24);
285 285
 		return $returnValue;
286 286
 	}
287 287
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 	 * @return bool
293 293
 	 */
294 294
 	public function remoteIsOwnCloud() {
295
-		if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) {
295
+		if (defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote().'/status.php')) {
296 296
 			return false;
297 297
 		}
298 298
 		return true;
@@ -310,11 +310,11 @@  discard block
 block discarded – undo
310 310
 		$password = $this->getPassword();
311 311
 
312 312
 		// If remote is not an ownCloud do not try to get any share info
313
-		if(!$this->remoteIsOwnCloud()) {
313
+		if (!$this->remoteIsOwnCloud()) {
314 314
 			return ['status' => 'unsupported'];
315 315
 		}
316 316
 
317
-		$url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token;
317
+		$url = rtrim($remote, '/').'/index.php/apps/files_sharing/shareinfo?t='.$token;
318 318
 
319 319
 		// TODO: DI
320 320
 		$client = \OC::$server->getHTTPClientService()->newClient();
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 		try {
383 383
 			$ocmPermissions = json_decode($ocmPermissions);
384 384
 			$ncPermissions = 0;
385
-			foreach($ocmPermissions as $permission) {
385
+			foreach ($ocmPermissions as $permission) {
386 386
 				switch (strtolower($permission)) {
387 387
 					case 'read':
388 388
 						$ncPermissions += Constants::PERMISSION_READ;
Please login to merge, or discard this patch.
lib/private/Server.php 1 patch
Spacing   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		// To find out if we are running from CLI or not
173 173
 		$this->registerParameter('isCLI', \OC::$CLI);
174 174
 
175
-		$this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) {
175
+		$this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) {
176 176
 			return $c;
177 177
 		});
178 178
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
186 186
 
187 187
 
188
-		$this->registerService(\OCP\IPreview::class, function (Server $c) {
188
+		$this->registerService(\OCP\IPreview::class, function(Server $c) {
189 189
 			return new PreviewManager(
190 190
 				$c->getConfig(),
191 191
 				$c->getRootFolder(),
@@ -196,13 +196,13 @@  discard block
 block discarded – undo
196 196
 		});
197 197
 		$this->registerAlias('PreviewManager', \OCP\IPreview::class);
198 198
 
199
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
199
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
200 200
 			return new \OC\Preview\Watcher(
201 201
 				$c->getAppDataDir('preview')
202 202
 			);
203 203
 		});
204 204
 
205
-		$this->registerService('EncryptionManager', function (Server $c) {
205
+		$this->registerService('EncryptionManager', function(Server $c) {
206 206
 			$view = new View();
207 207
 			$util = new Encryption\Util(
208 208
 				$view,
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 			);
221 221
 		});
222 222
 
223
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
223
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
224 224
 			$util = new Encryption\Util(
225 225
 				new View(),
226 226
 				$c->getUserManager(),
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 			);
235 235
 		});
236 236
 
237
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
237
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
238 238
 			$view = new View();
239 239
 			$util = new Encryption\Util(
240 240
 				$view,
@@ -245,30 +245,30 @@  discard block
 block discarded – undo
245 245
 
246 246
 			return new Encryption\Keys\Storage($view, $util);
247 247
 		});
248
-		$this->registerService('TagMapper', function (Server $c) {
248
+		$this->registerService('TagMapper', function(Server $c) {
249 249
 			return new TagMapper($c->getDatabaseConnection());
250 250
 		});
251 251
 
252
-		$this->registerService(\OCP\ITagManager::class, function (Server $c) {
252
+		$this->registerService(\OCP\ITagManager::class, function(Server $c) {
253 253
 			$tagMapper = $c->query('TagMapper');
254 254
 			return new TagManager($tagMapper, $c->getUserSession());
255 255
 		});
256 256
 		$this->registerAlias('TagManager', \OCP\ITagManager::class);
257 257
 
258
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
258
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
259 259
 			$config = $c->getConfig();
260 260
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
261 261
 			return new $factoryClass($this);
262 262
 		});
263
-		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) {
263
+		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) {
264 264
 			return $c->query('SystemTagManagerFactory')->getManager();
265 265
 		});
266 266
 		$this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class);
267 267
 
268
-		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) {
268
+		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) {
269 269
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
270 270
 		});
271
-		$this->registerService('RootFolder', function (Server $c) {
271
+		$this->registerService('RootFolder', function(Server $c) {
272 272
 			$manager = \OC\Files\Filesystem::getMountManager(null);
273 273
 			$view = new View();
274 274
 			$root = new Root(
@@ -289,38 +289,38 @@  discard block
 block discarded – undo
289 289
 		});
290 290
 		$this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class);
291 291
 
292
-		$this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) {
293
-			return new LazyRoot(function () use ($c) {
292
+		$this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) {
293
+			return new LazyRoot(function() use ($c) {
294 294
 				return $c->query('RootFolder');
295 295
 			});
296 296
 		});
297 297
 		$this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class);
298 298
 
299
-		$this->registerService(\OC\User\Manager::class, function (Server $c) {
299
+		$this->registerService(\OC\User\Manager::class, function(Server $c) {
300 300
 			$config = $c->getConfig();
301 301
 			return new \OC\User\Manager($config);
302 302
 		});
303 303
 		$this->registerAlias('UserManager', \OC\User\Manager::class);
304 304
 		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
305 305
 
306
-		$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
306
+		$this->registerService(\OCP\IGroupManager::class, function(Server $c) {
307 307
 			$groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger());
308
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
308
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
309 309
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));
310 310
 			});
311
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) {
311
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) {
312 312
 				\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID()));
313 313
 			});
314
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
314
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
315 315
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));
316 316
 			});
317
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
317
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
318 318
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));
319 319
 			});
320
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
320
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
321 321
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));
322 322
 			});
323
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
323
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
324 324
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
325 325
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
326 326
 				\OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 		});
330 330
 		$this->registerAlias('GroupManager', \OCP\IGroupManager::class);
331 331
 
332
-		$this->registerService(Store::class, function (Server $c) {
332
+		$this->registerService(Store::class, function(Server $c) {
333 333
 			$session = $c->getSession();
334 334
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
335 335
 				$tokenProvider = $c->query(IProvider::class);
@@ -340,13 +340,13 @@  discard block
 block discarded – undo
340 340
 			return new Store($session, $logger, $tokenProvider);
341 341
 		});
342 342
 		$this->registerAlias(IStore::class, Store::class);
343
-		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) {
343
+		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) {
344 344
 			$dbConnection = $c->getDatabaseConnection();
345 345
 			return new Authentication\Token\DefaultTokenMapper($dbConnection);
346 346
 		});
347 347
 		$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
348 348
 
349
-		$this->registerService(\OCP\IUserSession::class, function (Server $c) {
349
+		$this->registerService(\OCP\IUserSession::class, function(Server $c) {
350 350
 			$manager = $c->getUserManager();
351 351
 			$session = new \OC\Session\Memory('');
352 352
 			$timeFactory = new TimeFactory();
@@ -370,45 +370,45 @@  discard block
 block discarded – undo
370 370
 				$c->getLockdownManager(),
371 371
 				$c->getLogger()
372 372
 			);
373
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
373
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
374 374
 				\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
375 375
 			});
376
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
376
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
377 377
 				/** @var $user \OC\User\User */
378 378
 				\OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
379 379
 			});
380
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) {
380
+			$userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) {
381 381
 				/** @var $user \OC\User\User */
382 382
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
383 383
 				$dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
384 384
 			});
385
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
385
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
386 386
 				/** @var $user \OC\User\User */
387 387
 				\OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
388 388
 			});
389
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
389
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
390 390
 				/** @var $user \OC\User\User */
391 391
 				\OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
392 392
 			});
393
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
393
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
394 394
 				/** @var $user \OC\User\User */
395 395
 				\OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
396 396
 			});
397
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
397
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
398 398
 				\OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
399 399
 			});
400
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password) {
400
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password) {
401 401
 				/** @var $user \OC\User\User */
402 402
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
403 403
 			});
404
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
404
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
405 405
 				/** @var $user \OC\User\User */
406 406
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
407 407
 			});
408
-			$userSession->listen('\OC\User', 'logout', function () {
408
+			$userSession->listen('\OC\User', 'logout', function() {
409 409
 				\OC_Hook::emit('OC_User', 'logout', array());
410 410
 			});
411
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) {
411
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) {
412 412
 				/** @var $user \OC\User\User */
413 413
 				\OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue));
414 414
 				$dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value]));
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 		$this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class);
423 423
 		$this->registerAlias('NavigationManager', \OCP\INavigationManager::class);
424 424
 
425
-		$this->registerService(\OC\AllConfig::class, function (Server $c) {
425
+		$this->registerService(\OC\AllConfig::class, function(Server $c) {
426 426
 			return new \OC\AllConfig(
427 427
 				$c->getSystemConfig()
428 428
 			);
@@ -430,17 +430,17 @@  discard block
 block discarded – undo
430 430
 		$this->registerAlias('AllConfig', \OC\AllConfig::class);
431 431
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
432 432
 
433
-		$this->registerService('SystemConfig', function ($c) use ($config) {
433
+		$this->registerService('SystemConfig', function($c) use ($config) {
434 434
 			return new \OC\SystemConfig($config);
435 435
 		});
436 436
 
437
-		$this->registerService(\OC\AppConfig::class, function (Server $c) {
437
+		$this->registerService(\OC\AppConfig::class, function(Server $c) {
438 438
 			return new \OC\AppConfig($c->getDatabaseConnection());
439 439
 		});
440 440
 		$this->registerAlias('AppConfig', \OC\AppConfig::class);
441 441
 		$this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class);
442 442
 
443
-		$this->registerService(\OCP\L10N\IFactory::class, function (Server $c) {
443
+		$this->registerService(\OCP\L10N\IFactory::class, function(Server $c) {
444 444
 			return new \OC\L10N\Factory(
445 445
 				$c->getConfig(),
446 446
 				$c->getRequest(),
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 		});
451 451
 		$this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class);
452 452
 
453
-		$this->registerService(\OCP\IURLGenerator::class, function (Server $c) {
453
+		$this->registerService(\OCP\IURLGenerator::class, function(Server $c) {
454 454
 			$config = $c->getConfig();
455 455
 			$cacheFactory = $c->getMemCacheFactory();
456 456
 			$request = $c->getRequest();
@@ -465,12 +465,12 @@  discard block
 block discarded – undo
465 465
 		$this->registerAlias('AppFetcher', AppFetcher::class);
466 466
 		$this->registerAlias('CategoryFetcher', CategoryFetcher::class);
467 467
 
468
-		$this->registerService(\OCP\ICache::class, function ($c) {
468
+		$this->registerService(\OCP\ICache::class, function($c) {
469 469
 			return new Cache\File();
470 470
 		});
471 471
 		$this->registerAlias('UserCache', \OCP\ICache::class);
472 472
 
473
-		$this->registerService(Factory::class, function (Server $c) {
473
+		$this->registerService(Factory::class, function(Server $c) {
474 474
 
475 475
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(),
476 476
 				ArrayCache::class,
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 				$version = implode(',', $v);
488 488
 				$instanceId = \OC_Util::getInstanceId();
489 489
 				$path = \OC::$SERVERROOT;
490
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
490
+				$prefix = md5($instanceId.'-'.$version.'-'.$path);
491 491
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
492 492
 					$config->getSystemValue('memcache.local', null),
493 493
 					$config->getSystemValue('memcache.distributed', null),
@@ -500,12 +500,12 @@  discard block
 block discarded – undo
500 500
 		$this->registerAlias('MemCacheFactory', Factory::class);
501 501
 		$this->registerAlias(ICacheFactory::class, Factory::class);
502 502
 
503
-		$this->registerService('RedisFactory', function (Server $c) {
503
+		$this->registerService('RedisFactory', function(Server $c) {
504 504
 			$systemConfig = $c->getSystemConfig();
505 505
 			return new RedisFactory($systemConfig);
506 506
 		});
507 507
 
508
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
508
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
509 509
 			return new \OC\Activity\Manager(
510 510
 				$c->getRequest(),
511 511
 				$c->getUserSession(),
@@ -515,14 +515,14 @@  discard block
 block discarded – undo
515 515
 		});
516 516
 		$this->registerAlias('ActivityManager', \OCP\Activity\IManager::class);
517 517
 
518
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
518
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
519 519
 			return new \OC\Activity\EventMerger(
520 520
 				$c->getL10N('lib')
521 521
 			);
522 522
 		});
523 523
 		$this->registerAlias(IValidator::class, Validator::class);
524 524
 
525
-		$this->registerService(\OCP\IAvatarManager::class, function (Server $c) {
525
+		$this->registerService(\OCP\IAvatarManager::class, function(Server $c) {
526 526
 			return new AvatarManager(
527 527
 				$c->query(\OC\User\Manager::class),
528 528
 				$c->getAppDataDir('avatar'),
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 
536 536
 		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
537 537
 
538
-		$this->registerService(\OCP\ILogger::class, function (Server $c) {
538
+		$this->registerService(\OCP\ILogger::class, function(Server $c) {
539 539
 			$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file');
540 540
 			$factory = new LogFactory($c, $this->getSystemConfig());
541 541
 			$logger = $factory->get($logType);
@@ -545,11 +545,11 @@  discard block
 block discarded – undo
545 545
 		});
546 546
 		$this->registerAlias('Logger', \OCP\ILogger::class);
547 547
 
548
-		$this->registerService(ILogFactory::class, function (Server $c) {
548
+		$this->registerService(ILogFactory::class, function(Server $c) {
549 549
 			return new LogFactory($c, $this->getSystemConfig());
550 550
 		});
551 551
 
552
-		$this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) {
552
+		$this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) {
553 553
 			$config = $c->getConfig();
554 554
 			return new \OC\BackgroundJob\JobList(
555 555
 				$c->getDatabaseConnection(),
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 		});
560 560
 		$this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class);
561 561
 
562
-		$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
562
+		$this->registerService(\OCP\Route\IRouter::class, function(Server $c) {
563 563
 			$cacheFactory = $c->getMemCacheFactory();
564 564
 			$logger = $c->getLogger();
565 565
 			if ($cacheFactory->isLocalCacheAvailable()) {
@@ -571,12 +571,12 @@  discard block
 block discarded – undo
571 571
 		});
572 572
 		$this->registerAlias('Router', \OCP\Route\IRouter::class);
573 573
 
574
-		$this->registerService(\OCP\ISearch::class, function ($c) {
574
+		$this->registerService(\OCP\ISearch::class, function($c) {
575 575
 			return new Search();
576 576
 		});
577 577
 		$this->registerAlias('Search', \OCP\ISearch::class);
578 578
 
579
-		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) {
579
+		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) {
580 580
 			return new \OC\Security\RateLimiting\Limiter(
581 581
 				$this->getUserSession(),
582 582
 				$this->getRequest(),
@@ -584,34 +584,34 @@  discard block
 block discarded – undo
584 584
 				$c->query(\OC\Security\RateLimiting\Backend\IBackend::class)
585 585
 			);
586 586
 		});
587
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
587
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
588 588
 			return new \OC\Security\RateLimiting\Backend\MemoryCache(
589 589
 				$this->getMemCacheFactory(),
590 590
 				new \OC\AppFramework\Utility\TimeFactory()
591 591
 			);
592 592
 		});
593 593
 
594
-		$this->registerService(\OCP\Security\ISecureRandom::class, function ($c) {
594
+		$this->registerService(\OCP\Security\ISecureRandom::class, function($c) {
595 595
 			return new SecureRandom();
596 596
 		});
597 597
 		$this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
598 598
 
599
-		$this->registerService(\OCP\Security\ICrypto::class, function (Server $c) {
599
+		$this->registerService(\OCP\Security\ICrypto::class, function(Server $c) {
600 600
 			return new Crypto($c->getConfig(), $c->getSecureRandom());
601 601
 		});
602 602
 		$this->registerAlias('Crypto', \OCP\Security\ICrypto::class);
603 603
 
604
-		$this->registerService(\OCP\Security\IHasher::class, function (Server $c) {
604
+		$this->registerService(\OCP\Security\IHasher::class, function(Server $c) {
605 605
 			return new Hasher($c->getConfig());
606 606
 		});
607 607
 		$this->registerAlias('Hasher', \OCP\Security\IHasher::class);
608 608
 
609
-		$this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) {
609
+		$this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) {
610 610
 			return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection());
611 611
 		});
612 612
 		$this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class);
613 613
 
614
-		$this->registerService(IDBConnection::class, function (Server $c) {
614
+		$this->registerService(IDBConnection::class, function(Server $c) {
615 615
 			$systemConfig = $c->getSystemConfig();
616 616
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
617 617
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 		$this->registerAlias('DatabaseConnection', IDBConnection::class);
627 627
 
628 628
 
629
-		$this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) {
629
+		$this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) {
630 630
 			$user = \OC_User::getUser();
631 631
 			$uid = $user ? $user : null;
632 632
 			return new ClientService(
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 			);
642 642
 		});
643 643
 		$this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class);
644
-		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) {
644
+		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) {
645 645
 			$eventLogger = new EventLogger();
646 646
 			if ($c->getSystemConfig()->getValue('debug', false)) {
647 647
 				// In debug mode, module is being activated by default
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 		});
652 652
 		$this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class);
653 653
 
654
-		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) {
654
+		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) {
655 655
 			$queryLogger = new QueryLogger();
656 656
 			if ($c->getSystemConfig()->getValue('debug', false)) {
657 657
 				// In debug mode, module is being activated by default
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 		});
662 662
 		$this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class);
663 663
 
664
-		$this->registerService(TempManager::class, function (Server $c) {
664
+		$this->registerService(TempManager::class, function(Server $c) {
665 665
 			return new TempManager(
666 666
 				$c->getLogger(),
667 667
 				$c->getConfig()
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 		$this->registerAlias('TempManager', TempManager::class);
671 671
 		$this->registerAlias(ITempManager::class, TempManager::class);
672 672
 
673
-		$this->registerService(AppManager::class, function (Server $c) {
673
+		$this->registerService(AppManager::class, function(Server $c) {
674 674
 			return new \OC\App\AppManager(
675 675
 				$c->getUserSession(),
676 676
 				$c->query(\OC\AppConfig::class),
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 		$this->registerAlias('AppManager', AppManager::class);
683 683
 		$this->registerAlias(IAppManager::class, AppManager::class);
684 684
 
685
-		$this->registerService(\OCP\IDateTimeZone::class, function (Server $c) {
685
+		$this->registerService(\OCP\IDateTimeZone::class, function(Server $c) {
686 686
 			return new DateTimeZone(
687 687
 				$c->getConfig(),
688 688
 				$c->getSession()
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
 		});
691 691
 		$this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class);
692 692
 
693
-		$this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) {
693
+		$this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) {
694 694
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
695 695
 
696 696
 			return new DateTimeFormatter(
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 		});
701 701
 		$this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class);
702 702
 
703
-		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) {
703
+		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) {
704 704
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
705 705
 			$listener = new UserMountCacheListener($mountCache);
706 706
 			$listener->listen($c->getUserManager());
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 		});
709 709
 		$this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class);
710 710
 
711
-		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) {
711
+		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) {
712 712
 			$loader = \OC\Files\Filesystem::getLoader();
713 713
 			$mountCache = $c->query('UserMountCache');
714 714
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -724,10 +724,10 @@  discard block
 block discarded – undo
724 724
 		});
725 725
 		$this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class);
726 726
 
727
-		$this->registerService('IniWrapper', function ($c) {
727
+		$this->registerService('IniWrapper', function($c) {
728 728
 			return new IniGetWrapper();
729 729
 		});
730
-		$this->registerService('AsyncCommandBus', function (Server $c) {
730
+		$this->registerService('AsyncCommandBus', function(Server $c) {
731 731
 			$busClass = $c->getConfig()->getSystemValue('commandbus');
732 732
 			if ($busClass) {
733 733
 				list($app, $class) = explode('::', $busClass, 2);
@@ -742,10 +742,10 @@  discard block
 block discarded – undo
742 742
 				return new CronBus($jobList);
743 743
 			}
744 744
 		});
745
-		$this->registerService('TrustedDomainHelper', function ($c) {
745
+		$this->registerService('TrustedDomainHelper', function($c) {
746 746
 			return new TrustedDomainHelper($this->getConfig());
747 747
 		});
748
-		$this->registerService('Throttler', function (Server $c) {
748
+		$this->registerService('Throttler', function(Server $c) {
749 749
 			return new Throttler(
750 750
 				$c->getDatabaseConnection(),
751 751
 				new TimeFactory(),
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 				$c->getConfig()
754 754
 			);
755 755
 		});
756
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
756
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
757 757
 			// IConfig and IAppManager requires a working database. This code
758 758
 			// might however be called when ownCloud is not yet setup.
759 759
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 				$c->getTempManager()
775 775
 			);
776 776
 		});
777
-		$this->registerService(\OCP\IRequest::class, function ($c) {
777
+		$this->registerService(\OCP\IRequest::class, function($c) {
778 778
 			if (isset($this['urlParams'])) {
779 779
 				$urlParams = $this['urlParams'];
780 780
 			} else {
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 		});
811 811
 		$this->registerAlias('Request', \OCP\IRequest::class);
812 812
 
813
-		$this->registerService(\OCP\Mail\IMailer::class, function (Server $c) {
813
+		$this->registerService(\OCP\Mail\IMailer::class, function(Server $c) {
814 814
 			return new Mailer(
815 815
 				$c->getConfig(),
816 816
 				$c->getLogger(),
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 		});
822 822
 		$this->registerAlias('Mailer', \OCP\Mail\IMailer::class);
823 823
 
824
-		$this->registerService('LDAPProvider', function (Server $c) {
824
+		$this->registerService('LDAPProvider', function(Server $c) {
825 825
 			$config = $c->getConfig();
826 826
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
827 827
 			if (is_null($factoryClass)) {
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 			$factory = new $factoryClass($this);
832 832
 			return $factory->getLDAPProvider();
833 833
 		});
834
-		$this->registerService(ILockingProvider::class, function (Server $c) {
834
+		$this->registerService(ILockingProvider::class, function(Server $c) {
835 835
 			$ini = $c->getIniWrapper();
836 836
 			$config = $c->getConfig();
837 837
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -854,49 +854,49 @@  discard block
 block discarded – undo
854 854
 		});
855 855
 		$this->registerAlias('LockingProvider', ILockingProvider::class);
856 856
 
857
-		$this->registerService(\OCP\Files\Mount\IMountManager::class, function () {
857
+		$this->registerService(\OCP\Files\Mount\IMountManager::class, function() {
858 858
 			return new \OC\Files\Mount\Manager();
859 859
 		});
860 860
 		$this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class);
861 861
 
862
-		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) {
862
+		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) {
863 863
 			return new \OC\Files\Type\Detection(
864 864
 				$c->getURLGenerator(),
865 865
 				\OC::$configDir,
866
-				\OC::$SERVERROOT . '/resources/config/'
866
+				\OC::$SERVERROOT.'/resources/config/'
867 867
 			);
868 868
 		});
869 869
 		$this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class);
870 870
 
871
-		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) {
871
+		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) {
872 872
 			return new \OC\Files\Type\Loader(
873 873
 				$c->getDatabaseConnection()
874 874
 			);
875 875
 		});
876 876
 		$this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class);
877
-		$this->registerService(BundleFetcher::class, function () {
877
+		$this->registerService(BundleFetcher::class, function() {
878 878
 			return new BundleFetcher($this->getL10N('lib'));
879 879
 		});
880
-		$this->registerService(\OCP\Notification\IManager::class, function (Server $c) {
880
+		$this->registerService(\OCP\Notification\IManager::class, function(Server $c) {
881 881
 			return new Manager(
882 882
 				$c->query(IValidator::class)
883 883
 			);
884 884
 		});
885 885
 		$this->registerAlias('NotificationManager', \OCP\Notification\IManager::class);
886 886
 
887
-		$this->registerService(\OC\CapabilitiesManager::class, function (Server $c) {
887
+		$this->registerService(\OC\CapabilitiesManager::class, function(Server $c) {
888 888
 			$manager = new \OC\CapabilitiesManager($c->getLogger());
889
-			$manager->registerCapability(function () use ($c) {
889
+			$manager->registerCapability(function() use ($c) {
890 890
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
891 891
 			});
892
-			$manager->registerCapability(function () use ($c) {
892
+			$manager->registerCapability(function() use ($c) {
893 893
 				return $c->query(\OC\Security\Bruteforce\Capabilities::class);
894 894
 			});
895 895
 			return $manager;
896 896
 		});
897 897
 		$this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class);
898 898
 
899
-		$this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) {
899
+		$this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) {
900 900
 			$config = $c->getConfig();
901 901
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
902 902
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
 			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
907 907
 				$manager = $c->getUserManager();
908 908
 				$user = $manager->get($id);
909
-				if(is_null($user)) {
909
+				if (is_null($user)) {
910 910
 					$l = $c->getL10N('core');
911 911
 					$displayName = $l->t('Unknown user');
912 912
 				} else {
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 		});
920 920
 		$this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class);
921 921
 
922
-		$this->registerService('ThemingDefaults', function (Server $c) {
922
+		$this->registerService('ThemingDefaults', function(Server $c) {
923 923
 			/*
924 924
 			 * Dark magic for autoloader.
925 925
 			 * If we do a class_exists it will try to load the class which will
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 			}
947 947
 			return new \OC_Defaults();
948 948
 		});
949
-		$this->registerService(SCSSCacher::class, function (Server $c) {
949
+		$this->registerService(SCSSCacher::class, function(Server $c) {
950 950
 			/** @var Factory $cacheFactory */
951 951
 			$cacheFactory = $c->query(Factory::class);
952 952
 			return new SCSSCacher(
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
 				$this->getMemCacheFactory()
960 960
 			);
961 961
 		});
962
-		$this->registerService(JSCombiner::class, function (Server $c) {
962
+		$this->registerService(JSCombiner::class, function(Server $c) {
963 963
 			/** @var Factory $cacheFactory */
964 964
 			$cacheFactory = $c->query(Factory::class);
965 965
 			return new JSCombiner(
@@ -970,13 +970,13 @@  discard block
 block discarded – undo
970 970
 				$c->getLogger()
971 971
 			);
972 972
 		});
973
-		$this->registerService(EventDispatcher::class, function () {
973
+		$this->registerService(EventDispatcher::class, function() {
974 974
 			return new EventDispatcher();
975 975
 		});
976 976
 		$this->registerAlias('EventDispatcher', EventDispatcher::class);
977 977
 		$this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class);
978 978
 
979
-		$this->registerService('CryptoWrapper', function (Server $c) {
979
+		$this->registerService('CryptoWrapper', function(Server $c) {
980 980
 			// FIXME: Instantiiated here due to cyclic dependency
981 981
 			$request = new Request(
982 982
 				[
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 				$request
1002 1002
 			);
1003 1003
 		});
1004
-		$this->registerService('CsrfTokenManager', function (Server $c) {
1004
+		$this->registerService('CsrfTokenManager', function(Server $c) {
1005 1005
 			$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom());
1006 1006
 
1007 1007
 			return new CsrfTokenManager(
@@ -1009,22 +1009,22 @@  discard block
 block discarded – undo
1009 1009
 				$c->query(SessionStorage::class)
1010 1010
 			);
1011 1011
 		});
1012
-		$this->registerService(SessionStorage::class, function (Server $c) {
1012
+		$this->registerService(SessionStorage::class, function(Server $c) {
1013 1013
 			return new SessionStorage($c->getSession());
1014 1014
 		});
1015
-		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) {
1015
+		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) {
1016 1016
 			return new ContentSecurityPolicyManager();
1017 1017
 		});
1018 1018
 		$this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class);
1019 1019
 
1020
-		$this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) {
1020
+		$this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) {
1021 1021
 			return new ContentSecurityPolicyNonceManager(
1022 1022
 				$c->getCsrfTokenManager(),
1023 1023
 				$c->getRequest()
1024 1024
 			);
1025 1025
 		});
1026 1026
 
1027
-		$this->registerService(\OCP\Share\IManager::class, function (Server $c) {
1027
+		$this->registerService(\OCP\Share\IManager::class, function(Server $c) {
1028 1028
 			$config = $c->getConfig();
1029 1029
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1030 1030
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1067,7 +1067,7 @@  discard block
 block discarded – undo
1067 1067
 
1068 1068
 		$this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class);
1069 1069
 
1070
-		$this->registerService('SettingsManager', function (Server $c) {
1070
+		$this->registerService('SettingsManager', function(Server $c) {
1071 1071
 			$manager = new \OC\Settings\Manager(
1072 1072
 				$c->getLogger(),
1073 1073
 				$c->getDatabaseConnection(),
@@ -1085,36 +1085,36 @@  discard block
 block discarded – undo
1085 1085
 			);
1086 1086
 			return $manager;
1087 1087
 		});
1088
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
1088
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
1089 1089
 			return new \OC\Files\AppData\Factory(
1090 1090
 				$c->getRootFolder(),
1091 1091
 				$c->getSystemConfig()
1092 1092
 			);
1093 1093
 		});
1094 1094
 
1095
-		$this->registerService('LockdownManager', function (Server $c) {
1096
-			return new LockdownManager(function () use ($c) {
1095
+		$this->registerService('LockdownManager', function(Server $c) {
1096
+			return new LockdownManager(function() use ($c) {
1097 1097
 				return $c->getSession();
1098 1098
 			});
1099 1099
 		});
1100 1100
 
1101
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) {
1101
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) {
1102 1102
 			return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService());
1103 1103
 		});
1104 1104
 
1105
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
1105
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
1106 1106
 			return new CloudIdManager();
1107 1107
 		});
1108 1108
 
1109
-		$this->registerService(IConfig::class, function (Server $c) {
1109
+		$this->registerService(IConfig::class, function(Server $c) {
1110 1110
 			return new GlobalScale\Config($c->getConfig());
1111 1111
 		});
1112 1112
 
1113
-		$this->registerService(ICloudFederationProviderManager::class, function (Server $c) {
1113
+		$this->registerService(ICloudFederationProviderManager::class, function(Server $c) {
1114 1114
 			return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger());
1115 1115
 		});
1116 1116
 
1117
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1117
+		$this->registerService(ICloudFederationFactory::class, function(Server $c) {
1118 1118
 			return new CloudFederationFactory();
1119 1119
 		});
1120 1120
 
@@ -1124,18 +1124,18 @@  discard block
 block discarded – undo
1124 1124
 		$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1125 1125
 		$this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1126 1126
 
1127
-		$this->registerService(Defaults::class, function (Server $c) {
1127
+		$this->registerService(Defaults::class, function(Server $c) {
1128 1128
 			return new Defaults(
1129 1129
 				$c->getThemingDefaults()
1130 1130
 			);
1131 1131
 		});
1132 1132
 		$this->registerAlias('Defaults', \OCP\Defaults::class);
1133 1133
 
1134
-		$this->registerService(\OCP\ISession::class, function (SimpleContainer $c) {
1134
+		$this->registerService(\OCP\ISession::class, function(SimpleContainer $c) {
1135 1135
 			return $c->query(\OCP\IUserSession::class)->getSession();
1136 1136
 		});
1137 1137
 
1138
-		$this->registerService(IShareHelper::class, function (Server $c) {
1138
+		$this->registerService(IShareHelper::class, function(Server $c) {
1139 1139
 			return new ShareHelper(
1140 1140
 				$c->query(\OCP\Share\IManager::class)
1141 1141
 			);
@@ -1197,11 +1197,11 @@  discard block
 block discarded – undo
1197 1197
 				// no avatar to remove
1198 1198
 			} catch (\Exception $e) {
1199 1199
 				// Ignore exceptions
1200
-				$logger->info('Could not cleanup avatar of ' . $user->getUID());
1200
+				$logger->info('Could not cleanup avatar of '.$user->getUID());
1201 1201
 			}
1202 1202
 		});
1203 1203
 
1204
-		$dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) {
1204
+		$dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) {
1205 1205
 			$manager = $this->getAvatarManager();
1206 1206
 			/** @var IUser $user */
1207 1207
 			$user = $e->getSubject();
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
 	 * @deprecated since 9.2.0 use IAppData
1353 1353
 	 */
1354 1354
 	public function getAppFolder() {
1355
-		$dir = '/' . \OC_App::getCurrentApp();
1355
+		$dir = '/'.\OC_App::getCurrentApp();
1356 1356
 		$root = $this->getRootFolder();
1357 1357
 		if (!$root->nodeExists($dir)) {
1358 1358
 			$folder = $root->newFolder($dir);
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 	/**
1928 1928
 	 * @return \OCP\Collaboration\AutoComplete\IManager
1929 1929
 	 */
1930
-	public function getAutoCompleteManager(){
1930
+	public function getAutoCompleteManager() {
1931 1931
 		return $this->query(IManager::class);
1932 1932
 	}
1933 1933
 
Please login to merge, or discard this patch.