Completed
Pull Request — master (#6328)
by Blizzz
53:21 queued 33:22
created
lib/private/Collaboration/Collaborators/GroupPlugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,17 +56,17 @@
 block discarded – undo
56 56
 		$result = ['wide' => [], 'exact' => []];
57 57
 
58 58
 		$groups = $this->groupManager->search($search, $limit, $offset);
59
-		$groupIds = array_map(function (IGroup $group) { return $group->getGID(); }, $groups);
59
+		$groupIds = array_map(function(IGroup $group) { return $group->getGID(); }, $groups);
60 60
 
61 61
 		if (!$this->shareeEnumeration || sizeof($groups) < $limit) {
62 62
 			$hasMoreResults = true;
63 63
 		}
64 64
 
65
-		$userGroups =  [];
65
+		$userGroups = [];
66 66
 		if (!empty($groups) && $this->shareWithGroupOnly) {
67 67
 			// Intersect all the groups that match with the groups this user is a member of
68 68
 			$userGroups = $this->groupManager->getUserGroups($this->userSession->getUser());
69
-			$userGroups = array_map(function (IGroup $group) { return $group->getGID(); }, $userGroups);
69
+			$userGroups = array_map(function(IGroup $group) { return $group->getGID(); }, $userGroups);
70 70
 			$groupIds = array_intersect($groupIds, $userGroups);
71 71
 		}
72 72
 
Please login to merge, or discard this patch.
lib/private/Collaboration/Collaborators/LookupPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 		try {
55 55
 			$client = $this->clientService->newClient();
56 56
 			$response = $client->get(
57
-				$lookupServerUrl . '/users?search=' . urlencode($search),
57
+				$lookupServerUrl.'/users?search='.urlencode($search),
58 58
 				[
59 59
 					'timeout' => 10,
60 60
 					'connect_timeout' => 3,
Please login to merge, or discard this patch.
lib/private/Server.php 1 patch
Spacing   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		parent::__construct();
142 142
 		$this->webRoot = $webRoot;
143 143
 
144
-		$this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) {
144
+		$this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) {
145 145
 			return $c;
146 146
 		});
147 147
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
152 152
 
153 153
 
154
-		$this->registerService(\OCP\IPreview::class, function (Server $c) {
154
+		$this->registerService(\OCP\IPreview::class, function(Server $c) {
155 155
 			return new PreviewManager(
156 156
 				$c->getConfig(),
157 157
 				$c->getRootFolder(),
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
 		});
163 163
 		$this->registerAlias('PreviewManager', \OCP\IPreview::class);
164 164
 
165
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
165
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
166 166
 			return new \OC\Preview\Watcher(
167 167
 				$c->getAppDataDir('preview')
168 168
 			);
169 169
 		});
170 170
 
171
-		$this->registerService('EncryptionManager', function (Server $c) {
171
+		$this->registerService('EncryptionManager', function(Server $c) {
172 172
 			$view = new View();
173 173
 			$util = new Encryption\Util(
174 174
 				$view,
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			);
187 187
 		});
188 188
 
189
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
189
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
190 190
 			$util = new Encryption\Util(
191 191
 				new View(),
192 192
 				$c->getUserManager(),
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 			);
201 201
 		});
202 202
 
203
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
203
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
204 204
 			$view = new View();
205 205
 			$util = new Encryption\Util(
206 206
 				$view,
@@ -211,32 +211,32 @@  discard block
 block discarded – undo
211 211
 
212 212
 			return new Encryption\Keys\Storage($view, $util);
213 213
 		});
214
-		$this->registerService('TagMapper', function (Server $c) {
214
+		$this->registerService('TagMapper', function(Server $c) {
215 215
 			return new TagMapper($c->getDatabaseConnection());
216 216
 		});
217 217
 
218
-		$this->registerService(\OCP\ITagManager::class, function (Server $c) {
218
+		$this->registerService(\OCP\ITagManager::class, function(Server $c) {
219 219
 			$tagMapper = $c->query('TagMapper');
220 220
 			return new TagManager($tagMapper, $c->getUserSession());
221 221
 		});
222 222
 		$this->registerAlias('TagManager', \OCP\ITagManager::class);
223 223
 
224
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
224
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
225 225
 			$config = $c->getConfig();
226 226
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory');
227 227
 			/** @var \OC\SystemTag\ManagerFactory $factory */
228 228
 			$factory = new $factoryClass($this);
229 229
 			return $factory;
230 230
 		});
231
-		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) {
231
+		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) {
232 232
 			return $c->query('SystemTagManagerFactory')->getManager();
233 233
 		});
234 234
 		$this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class);
235 235
 
236
-		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) {
236
+		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) {
237 237
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
238 238
 		});
239
-		$this->registerService('RootFolder', function (Server $c) {
239
+		$this->registerService('RootFolder', function(Server $c) {
240 240
 			$manager = \OC\Files\Filesystem::getMountManager(null);
241 241
 			$view = new View();
242 242
 			$root = new Root(
@@ -257,37 +257,37 @@  discard block
 block discarded – undo
257 257
 		});
258 258
 		$this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class);
259 259
 
260
-		$this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) {
261
-			return new LazyRoot(function () use ($c) {
260
+		$this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) {
261
+			return new LazyRoot(function() use ($c) {
262 262
 				return $c->query('RootFolder');
263 263
 			});
264 264
 		});
265 265
 		$this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class);
266 266
 
267
-		$this->registerService(\OCP\IUserManager::class, function (Server $c) {
267
+		$this->registerService(\OCP\IUserManager::class, function(Server $c) {
268 268
 			$config = $c->getConfig();
269 269
 			return new \OC\User\Manager($config);
270 270
 		});
271 271
 		$this->registerAlias('UserManager', \OCP\IUserManager::class);
272 272
 
273
-		$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
273
+		$this->registerService(\OCP\IGroupManager::class, function(Server $c) {
274 274
 			$groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger());
275
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
275
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
276 276
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));
277 277
 			});
278
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) {
278
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) {
279 279
 				\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID()));
280 280
 			});
281
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
281
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
282 282
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));
283 283
 			});
284
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
284
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
285 285
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));
286 286
 			});
287
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
287
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
288 288
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));
289 289
 			});
290
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
290
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
291 291
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
292 292
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
293 293
 				\OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 		});
297 297
 		$this->registerAlias('GroupManager', \OCP\IGroupManager::class);
298 298
 
299
-		$this->registerService(Store::class, function (Server $c) {
299
+		$this->registerService(Store::class, function(Server $c) {
300 300
 			$session = $c->getSession();
301 301
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
302 302
 				$tokenProvider = $c->query('OC\Authentication\Token\IProvider');
@@ -307,11 +307,11 @@  discard block
 block discarded – undo
307 307
 			return new Store($session, $logger, $tokenProvider);
308 308
 		});
309 309
 		$this->registerAlias(IStore::class, Store::class);
310
-		$this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) {
310
+		$this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) {
311 311
 			$dbConnection = $c->getDatabaseConnection();
312 312
 			return new Authentication\Token\DefaultTokenMapper($dbConnection);
313 313
 		});
314
-		$this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) {
314
+		$this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) {
315 315
 			$mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper');
316 316
 			$crypto = $c->getCrypto();
317 317
 			$config = $c->getConfig();
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 		});
322 322
 		$this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider');
323 323
 
324
-		$this->registerService(\OCP\IUserSession::class, function (Server $c) {
324
+		$this->registerService(\OCP\IUserSession::class, function(Server $c) {
325 325
 			$manager = $c->getUserManager();
326 326
 			$session = new \OC\Session\Memory('');
327 327
 			$timeFactory = new TimeFactory();
@@ -334,44 +334,44 @@  discard block
 block discarded – undo
334 334
 			}
335 335
 
336 336
 			$userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom(), $c->getLockdownManager());
337
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
337
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
338 338
 				\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
339 339
 			});
340
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
340
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
341 341
 				/** @var $user \OC\User\User */
342 342
 				\OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
343 343
 			});
344
-			$userSession->listen('\OC\User', 'preDelete', function ($user) {
344
+			$userSession->listen('\OC\User', 'preDelete', function($user) {
345 345
 				/** @var $user \OC\User\User */
346 346
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
347 347
 			});
348
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
348
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
349 349
 				/** @var $user \OC\User\User */
350 350
 				\OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
351 351
 			});
352
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
352
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
353 353
 				/** @var $user \OC\User\User */
354 354
 				\OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
355 355
 			});
356
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
356
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
357 357
 				/** @var $user \OC\User\User */
358 358
 				\OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
359 359
 			});
360
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
360
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
361 361
 				\OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
362 362
 			});
363
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password) {
363
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password) {
364 364
 				/** @var $user \OC\User\User */
365 365
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
366 366
 			});
367
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
367
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
368 368
 				/** @var $user \OC\User\User */
369 369
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
370 370
 			});
371
-			$userSession->listen('\OC\User', 'logout', function () {
371
+			$userSession->listen('\OC\User', 'logout', function() {
372 372
 				\OC_Hook::emit('OC_User', 'logout', array());
373 373
 			});
374
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
374
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) {
375 375
 				/** @var $user \OC\User\User */
376 376
 				\OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue));
377 377
 			});
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 		});
380 380
 		$this->registerAlias('UserSession', \OCP\IUserSession::class);
381 381
 
382
-		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) {
382
+		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) {
383 383
 			return new \OC\Authentication\TwoFactorAuth\Manager(
384 384
 				$c->getAppManager(),
385 385
 				$c->getSession(),
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 		$this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class);
395 395
 		$this->registerAlias('NavigationManager', \OCP\INavigationManager::class);
396 396
 
397
-		$this->registerService(\OC\AllConfig::class, function (Server $c) {
397
+		$this->registerService(\OC\AllConfig::class, function(Server $c) {
398 398
 			return new \OC\AllConfig(
399 399
 				$c->getSystemConfig()
400 400
 			);
@@ -402,17 +402,17 @@  discard block
 block discarded – undo
402 402
 		$this->registerAlias('AllConfig', \OC\AllConfig::class);
403 403
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
404 404
 
405
-		$this->registerService('SystemConfig', function ($c) use ($config) {
405
+		$this->registerService('SystemConfig', function($c) use ($config) {
406 406
 			return new \OC\SystemConfig($config);
407 407
 		});
408 408
 
409
-		$this->registerService(\OC\AppConfig::class, function (Server $c) {
409
+		$this->registerService(\OC\AppConfig::class, function(Server $c) {
410 410
 			return new \OC\AppConfig($c->getDatabaseConnection());
411 411
 		});
412 412
 		$this->registerAlias('AppConfig', \OC\AppConfig::class);
413 413
 		$this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class);
414 414
 
415
-		$this->registerService(\OCP\L10N\IFactory::class, function (Server $c) {
415
+		$this->registerService(\OCP\L10N\IFactory::class, function(Server $c) {
416 416
 			return new \OC\L10N\Factory(
417 417
 				$c->getConfig(),
418 418
 				$c->getRequest(),
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 		});
423 423
 		$this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class);
424 424
 
425
-		$this->registerService(\OCP\IURLGenerator::class, function (Server $c) {
425
+		$this->registerService(\OCP\IURLGenerator::class, function(Server $c) {
426 426
 			$config = $c->getConfig();
427 427
 			$cacheFactory = $c->getMemCacheFactory();
428 428
 			$request = $c->getRequest();
@@ -434,18 +434,18 @@  discard block
 block discarded – undo
434 434
 		});
435 435
 		$this->registerAlias('URLGenerator', \OCP\IURLGenerator::class);
436 436
 
437
-		$this->registerService('AppHelper', function ($c) {
437
+		$this->registerService('AppHelper', function($c) {
438 438
 			return new \OC\AppHelper();
439 439
 		});
440 440
 		$this->registerAlias('AppFetcher', AppFetcher::class);
441 441
 		$this->registerAlias('CategoryFetcher', CategoryFetcher::class);
442 442
 
443
-		$this->registerService(\OCP\ICache::class, function ($c) {
443
+		$this->registerService(\OCP\ICache::class, function($c) {
444 444
 			return new Cache\File();
445 445
 		});
446 446
 		$this->registerAlias('UserCache', \OCP\ICache::class);
447 447
 
448
-		$this->registerService(Factory::class, function (Server $c) {
448
+		$this->registerService(Factory::class, function(Server $c) {
449 449
 
450 450
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(),
451 451
 				'\\OC\\Memcache\\ArrayCache',
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 				$version = implode(',', $v);
463 463
 				$instanceId = \OC_Util::getInstanceId();
464 464
 				$path = \OC::$SERVERROOT;
465
-				$prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . $urlGenerator->getBaseUrl());
465
+				$prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.$urlGenerator->getBaseUrl());
466 466
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
467 467
 					$config->getSystemValue('memcache.local', null),
468 468
 					$config->getSystemValue('memcache.distributed', null),
@@ -475,12 +475,12 @@  discard block
 block discarded – undo
475 475
 		$this->registerAlias('MemCacheFactory', Factory::class);
476 476
 		$this->registerAlias(ICacheFactory::class, Factory::class);
477 477
 
478
-		$this->registerService('RedisFactory', function (Server $c) {
478
+		$this->registerService('RedisFactory', function(Server $c) {
479 479
 			$systemConfig = $c->getSystemConfig();
480 480
 			return new RedisFactory($systemConfig);
481 481
 		});
482 482
 
483
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
483
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
484 484
 			return new \OC\Activity\Manager(
485 485
 				$c->getRequest(),
486 486
 				$c->getUserSession(),
@@ -490,14 +490,14 @@  discard block
 block discarded – undo
490 490
 		});
491 491
 		$this->registerAlias('ActivityManager', \OCP\Activity\IManager::class);
492 492
 
493
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
493
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
494 494
 			return new \OC\Activity\EventMerger(
495 495
 				$c->getL10N('lib')
496 496
 			);
497 497
 		});
498 498
 		$this->registerAlias(IValidator::class, Validator::class);
499 499
 
500
-		$this->registerService(\OCP\IAvatarManager::class, function (Server $c) {
500
+		$this->registerService(\OCP\IAvatarManager::class, function(Server $c) {
501 501
 			return new AvatarManager(
502 502
 				$c->getUserManager(),
503 503
 				$c->getAppDataDir('avatar'),
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 		});
509 509
 		$this->registerAlias('AvatarManager', \OCP\IAvatarManager::class);
510 510
 
511
-		$this->registerService(\OCP\ILogger::class, function (Server $c) {
511
+		$this->registerService(\OCP\ILogger::class, function(Server $c) {
512 512
 			$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file');
513 513
 			$logger = Log::getLogClass($logType);
514 514
 			call_user_func(array($logger, 'init'));
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 		});
518 518
 		$this->registerAlias('Logger', \OCP\ILogger::class);
519 519
 
520
-		$this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) {
520
+		$this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) {
521 521
 			$config = $c->getConfig();
522 522
 			return new \OC\BackgroundJob\JobList(
523 523
 				$c->getDatabaseConnection(),
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 		});
528 528
 		$this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class);
529 529
 
530
-		$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
530
+		$this->registerService(\OCP\Route\IRouter::class, function(Server $c) {
531 531
 			$cacheFactory = $c->getMemCacheFactory();
532 532
 			$logger = $c->getLogger();
533 533
 			if ($cacheFactory->isAvailable()) {
@@ -539,12 +539,12 @@  discard block
 block discarded – undo
539 539
 		});
540 540
 		$this->registerAlias('Router', \OCP\Route\IRouter::class);
541 541
 
542
-		$this->registerService(\OCP\ISearch::class, function ($c) {
542
+		$this->registerService(\OCP\ISearch::class, function($c) {
543 543
 			return new Search();
544 544
 		});
545 545
 		$this->registerAlias('Search', \OCP\ISearch::class);
546 546
 
547
-		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function ($c) {
547
+		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function($c) {
548 548
 			return new \OC\Security\RateLimiting\Limiter(
549 549
 				$this->getUserSession(),
550 550
 				$this->getRequest(),
@@ -552,34 +552,34 @@  discard block
 block discarded – undo
552 552
 				$c->query(\OC\Security\RateLimiting\Backend\IBackend::class)
553 553
 			);
554 554
 		});
555
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
555
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
556 556
 			return new \OC\Security\RateLimiting\Backend\MemoryCache(
557 557
 				$this->getMemCacheFactory(),
558 558
 				new \OC\AppFramework\Utility\TimeFactory()
559 559
 			);
560 560
 		});
561 561
 
562
-		$this->registerService(\OCP\Security\ISecureRandom::class, function ($c) {
562
+		$this->registerService(\OCP\Security\ISecureRandom::class, function($c) {
563 563
 			return new SecureRandom();
564 564
 		});
565 565
 		$this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
566 566
 
567
-		$this->registerService(\OCP\Security\ICrypto::class, function (Server $c) {
567
+		$this->registerService(\OCP\Security\ICrypto::class, function(Server $c) {
568 568
 			return new Crypto($c->getConfig(), $c->getSecureRandom());
569 569
 		});
570 570
 		$this->registerAlias('Crypto', \OCP\Security\ICrypto::class);
571 571
 
572
-		$this->registerService(\OCP\Security\IHasher::class, function (Server $c) {
572
+		$this->registerService(\OCP\Security\IHasher::class, function(Server $c) {
573 573
 			return new Hasher($c->getConfig());
574 574
 		});
575 575
 		$this->registerAlias('Hasher', \OCP\Security\IHasher::class);
576 576
 
577
-		$this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) {
577
+		$this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) {
578 578
 			return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection());
579 579
 		});
580 580
 		$this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class);
581 581
 
582
-		$this->registerService(IDBConnection::class, function (Server $c) {
582
+		$this->registerService(IDBConnection::class, function(Server $c) {
583 583
 			$systemConfig = $c->getSystemConfig();
584 584
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
585 585
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 		});
594 594
 		$this->registerAlias('DatabaseConnection', IDBConnection::class);
595 595
 
596
-		$this->registerService('HTTPHelper', function (Server $c) {
596
+		$this->registerService('HTTPHelper', function(Server $c) {
597 597
 			$config = $c->getConfig();
598 598
 			return new HTTPHelper(
599 599
 				$config,
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 			);
602 602
 		});
603 603
 
604
-		$this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) {
604
+		$this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) {
605 605
 			$user = \OC_User::getUser();
606 606
 			$uid = $user ? $user : null;
607 607
 			return new ClientService(
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 			);
617 617
 		});
618 618
 		$this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class);
619
-		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) {
619
+		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) {
620 620
 			$eventLogger = new EventLogger();
621 621
 			if ($c->getSystemConfig()->getValue('debug', false)) {
622 622
 				// In debug mode, module is being activated by default
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 		});
627 627
 		$this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class);
628 628
 
629
-		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) {
629
+		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) {
630 630
 			$queryLogger = new QueryLogger();
631 631
 			if ($c->getSystemConfig()->getValue('debug', false)) {
632 632
 				// In debug mode, module is being activated by default
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 		});
637 637
 		$this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class);
638 638
 
639
-		$this->registerService(TempManager::class, function (Server $c) {
639
+		$this->registerService(TempManager::class, function(Server $c) {
640 640
 			return new TempManager(
641 641
 				$c->getLogger(),
642 642
 				$c->getConfig()
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 		$this->registerAlias('TempManager', TempManager::class);
646 646
 		$this->registerAlias(ITempManager::class, TempManager::class);
647 647
 
648
-		$this->registerService(AppManager::class, function (Server $c) {
648
+		$this->registerService(AppManager::class, function(Server $c) {
649 649
 			return new \OC\App\AppManager(
650 650
 				$c->getUserSession(),
651 651
 				$c->getAppConfig(),
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 		$this->registerAlias('AppManager', AppManager::class);
658 658
 		$this->registerAlias(IAppManager::class, AppManager::class);
659 659
 
660
-		$this->registerService(\OCP\IDateTimeZone::class, function (Server $c) {
660
+		$this->registerService(\OCP\IDateTimeZone::class, function(Server $c) {
661 661
 			return new DateTimeZone(
662 662
 				$c->getConfig(),
663 663
 				$c->getSession()
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 		});
666 666
 		$this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class);
667 667
 
668
-		$this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) {
668
+		$this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) {
669 669
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
670 670
 
671 671
 			return new DateTimeFormatter(
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 		});
676 676
 		$this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class);
677 677
 
678
-		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) {
678
+		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) {
679 679
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
680 680
 			$listener = new UserMountCacheListener($mountCache);
681 681
 			$listener->listen($c->getUserManager());
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 		});
684 684
 		$this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class);
685 685
 
686
-		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) {
686
+		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) {
687 687
 			$loader = \OC\Files\Filesystem::getLoader();
688 688
 			$mountCache = $c->query('UserMountCache');
689 689
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -699,10 +699,10 @@  discard block
 block discarded – undo
699 699
 		});
700 700
 		$this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class);
701 701
 
702
-		$this->registerService('IniWrapper', function ($c) {
702
+		$this->registerService('IniWrapper', function($c) {
703 703
 			return new IniGetWrapper();
704 704
 		});
705
-		$this->registerService('AsyncCommandBus', function (Server $c) {
705
+		$this->registerService('AsyncCommandBus', function(Server $c) {
706 706
 			$busClass = $c->getConfig()->getSystemValue('commandbus');
707 707
 			if ($busClass) {
708 708
 				list($app, $class) = explode('::', $busClass, 2);
@@ -717,10 +717,10 @@  discard block
 block discarded – undo
717 717
 				return new CronBus($jobList);
718 718
 			}
719 719
 		});
720
-		$this->registerService('TrustedDomainHelper', function ($c) {
720
+		$this->registerService('TrustedDomainHelper', function($c) {
721 721
 			return new TrustedDomainHelper($this->getConfig());
722 722
 		});
723
-		$this->registerService('Throttler', function (Server $c) {
723
+		$this->registerService('Throttler', function(Server $c) {
724 724
 			return new Throttler(
725 725
 				$c->getDatabaseConnection(),
726 726
 				new TimeFactory(),
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 				$c->getConfig()
729 729
 			);
730 730
 		});
731
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
731
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
732 732
 			// IConfig and IAppManager requires a working database. This code
733 733
 			// might however be called when ownCloud is not yet setup.
734 734
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 				$c->getTempManager()
750 750
 			);
751 751
 		});
752
-		$this->registerService(\OCP\IRequest::class, function ($c) {
752
+		$this->registerService(\OCP\IRequest::class, function($c) {
753 753
 			if (isset($this['urlParams'])) {
754 754
 				$urlParams = $this['urlParams'];
755 755
 			} else {
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 		});
786 786
 		$this->registerAlias('Request', \OCP\IRequest::class);
787 787
 
788
-		$this->registerService(\OCP\Mail\IMailer::class, function (Server $c) {
788
+		$this->registerService(\OCP\Mail\IMailer::class, function(Server $c) {
789 789
 			return new Mailer(
790 790
 				$c->getConfig(),
791 791
 				$c->getLogger(),
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 		});
797 797
 		$this->registerAlias('Mailer', \OCP\Mail\IMailer::class);
798 798
 
799
-		$this->registerService('LDAPProvider', function (Server $c) {
799
+		$this->registerService('LDAPProvider', function(Server $c) {
800 800
 			$config = $c->getConfig();
801 801
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
802 802
 			if (is_null($factoryClass)) {
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 			$factory = new $factoryClass($this);
807 807
 			return $factory->getLDAPProvider();
808 808
 		});
809
-		$this->registerService(ILockingProvider::class, function (Server $c) {
809
+		$this->registerService(ILockingProvider::class, function(Server $c) {
810 810
 			$ini = $c->getIniWrapper();
811 811
 			$config = $c->getConfig();
812 812
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -823,49 +823,49 @@  discard block
 block discarded – undo
823 823
 		});
824 824
 		$this->registerAlias('LockingProvider', ILockingProvider::class);
825 825
 
826
-		$this->registerService(\OCP\Files\Mount\IMountManager::class, function () {
826
+		$this->registerService(\OCP\Files\Mount\IMountManager::class, function() {
827 827
 			return new \OC\Files\Mount\Manager();
828 828
 		});
829 829
 		$this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class);
830 830
 
831
-		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) {
831
+		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) {
832 832
 			return new \OC\Files\Type\Detection(
833 833
 				$c->getURLGenerator(),
834 834
 				\OC::$configDir,
835
-				\OC::$SERVERROOT . '/resources/config/'
835
+				\OC::$SERVERROOT.'/resources/config/'
836 836
 			);
837 837
 		});
838 838
 		$this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class);
839 839
 
840
-		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) {
840
+		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) {
841 841
 			return new \OC\Files\Type\Loader(
842 842
 				$c->getDatabaseConnection()
843 843
 			);
844 844
 		});
845 845
 		$this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class);
846
-		$this->registerService(BundleFetcher::class, function () {
846
+		$this->registerService(BundleFetcher::class, function() {
847 847
 			return new BundleFetcher($this->getL10N('lib'));
848 848
 		});
849
-		$this->registerService(\OCP\Notification\IManager::class, function (Server $c) {
849
+		$this->registerService(\OCP\Notification\IManager::class, function(Server $c) {
850 850
 			return new Manager(
851 851
 				$c->query(IValidator::class)
852 852
 			);
853 853
 		});
854 854
 		$this->registerAlias('NotificationManager', \OCP\Notification\IManager::class);
855 855
 
856
-		$this->registerService(\OC\CapabilitiesManager::class, function (Server $c) {
856
+		$this->registerService(\OC\CapabilitiesManager::class, function(Server $c) {
857 857
 			$manager = new \OC\CapabilitiesManager($c->getLogger());
858
-			$manager->registerCapability(function () use ($c) {
858
+			$manager->registerCapability(function() use ($c) {
859 859
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
860 860
 			});
861
-			$manager->registerCapability(function () use ($c) {
861
+			$manager->registerCapability(function() use ($c) {
862 862
 				return $c->query(\OC\Security\Bruteforce\Capabilities::class);
863 863
 			});
864 864
 			return $manager;
865 865
 		});
866 866
 		$this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class);
867 867
 
868
-		$this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) {
868
+		$this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) {
869 869
 			$config = $c->getConfig();
870 870
 			$factoryClass = $config->getSystemValue('comments.managerFactory', '\OC\Comments\ManagerFactory');
871 871
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 		});
875 875
 		$this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class);
876 876
 
877
-		$this->registerService('ThemingDefaults', function (Server $c) {
877
+		$this->registerService('ThemingDefaults', function(Server $c) {
878 878
 			/*
879 879
 			 * Dark magic for autoloader.
880 880
 			 * If we do a class_exists it will try to load the class which will
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 			}
901 901
 			return new \OC_Defaults();
902 902
 		});
903
-		$this->registerService(SCSSCacher::class, function (Server $c) {
903
+		$this->registerService(SCSSCacher::class, function(Server $c) {
904 904
 			/** @var Factory $cacheFactory */
905 905
 			$cacheFactory = $c->query(Factory::class);
906 906
 			return new SCSSCacher(
@@ -913,13 +913,13 @@  discard block
 block discarded – undo
913 913
 				$cacheFactory->create('SCSS')
914 914
 			);
915 915
 		});
916
-		$this->registerService(EventDispatcher::class, function () {
916
+		$this->registerService(EventDispatcher::class, function() {
917 917
 			return new EventDispatcher();
918 918
 		});
919 919
 		$this->registerAlias('EventDispatcher', EventDispatcher::class);
920 920
 		$this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class);
921 921
 
922
-		$this->registerService('CryptoWrapper', function (Server $c) {
922
+		$this->registerService('CryptoWrapper', function(Server $c) {
923 923
 			// FIXME: Instantiiated here due to cyclic dependency
924 924
 			$request = new Request(
925 925
 				[
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
 				$request
945 945
 			);
946 946
 		});
947
-		$this->registerService('CsrfTokenManager', function (Server $c) {
947
+		$this->registerService('CsrfTokenManager', function(Server $c) {
948 948
 			$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom());
949 949
 
950 950
 			return new CsrfTokenManager(
@@ -952,22 +952,22 @@  discard block
 block discarded – undo
952 952
 				$c->query(SessionStorage::class)
953 953
 			);
954 954
 		});
955
-		$this->registerService(SessionStorage::class, function (Server $c) {
955
+		$this->registerService(SessionStorage::class, function(Server $c) {
956 956
 			return new SessionStorage($c->getSession());
957 957
 		});
958
-		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) {
958
+		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) {
959 959
 			return new ContentSecurityPolicyManager();
960 960
 		});
961 961
 		$this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class);
962 962
 
963
-		$this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) {
963
+		$this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) {
964 964
 			return new ContentSecurityPolicyNonceManager(
965 965
 				$c->getCsrfTokenManager(),
966 966
 				$c->getRequest()
967 967
 			);
968 968
 		});
969 969
 
970
-		$this->registerService(\OCP\Share\IManager::class, function (Server $c) {
970
+		$this->registerService(\OCP\Share\IManager::class, function(Server $c) {
971 971
 			$config = $c->getConfig();
972 972
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', '\OC\Share20\ProviderFactory');
973 973
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
 		});
1000 1000
 		$this->registerAlias('CollaboratorSearch', \OCP\Collaboration\Collaborators\ISearch::class);
1001 1001
 
1002
-		$this->registerService('SettingsManager', function (Server $c) {
1002
+		$this->registerService('SettingsManager', function(Server $c) {
1003 1003
 			$manager = new \OC\Settings\Manager(
1004 1004
 				$c->getLogger(),
1005 1005
 				$c->getDatabaseConnection(),
@@ -1019,29 +1019,29 @@  discard block
 block discarded – undo
1019 1019
 			);
1020 1020
 			return $manager;
1021 1021
 		});
1022
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
1022
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
1023 1023
 			return new \OC\Files\AppData\Factory(
1024 1024
 				$c->getRootFolder(),
1025 1025
 				$c->getSystemConfig()
1026 1026
 			);
1027 1027
 		});
1028 1028
 
1029
-		$this->registerService('LockdownManager', function (Server $c) {
1030
-			return new LockdownManager(function () use ($c) {
1029
+		$this->registerService('LockdownManager', function(Server $c) {
1030
+			return new LockdownManager(function() use ($c) {
1031 1031
 				return $c->getSession();
1032 1032
 			});
1033 1033
 		});
1034 1034
 
1035
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) {
1035
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) {
1036 1036
 			return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService());
1037 1037
 		});
1038 1038
 
1039
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
1039
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
1040 1040
 			return new CloudIdManager();
1041 1041
 		});
1042 1042
 
1043 1043
 		/* To trick DI since we don't extend the DIContainer here */
1044
-		$this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) {
1044
+		$this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) {
1045 1045
 			return new CleanPreviewsBackgroundJob(
1046 1046
 				$c->getRootFolder(),
1047 1047
 				$c->getLogger(),
@@ -1056,18 +1056,18 @@  discard block
 block discarded – undo
1056 1056
 		$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1057 1057
 		$this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1058 1058
 
1059
-		$this->registerService(Defaults::class, function (Server $c) {
1059
+		$this->registerService(Defaults::class, function(Server $c) {
1060 1060
 			return new Defaults(
1061 1061
 				$c->getThemingDefaults()
1062 1062
 			);
1063 1063
 		});
1064 1064
 		$this->registerAlias('Defaults', \OCP\Defaults::class);
1065 1065
 
1066
-		$this->registerService(\OCP\ISession::class, function (SimpleContainer $c) {
1066
+		$this->registerService(\OCP\ISession::class, function(SimpleContainer $c) {
1067 1067
 			return $c->query(\OCP\IUserSession::class)->getSession();
1068 1068
 		});
1069 1069
 
1070
-		$this->registerService(IShareHelper::class, function (Server $c) {
1070
+		$this->registerService(IShareHelper::class, function(Server $c) {
1071 1071
 			return new ShareHelper(
1072 1072
 				$c->query(\OCP\Share\IManager::class)
1073 1073
 			);
@@ -1208,7 +1208,7 @@  discard block
 block discarded – undo
1208 1208
 	 * @deprecated since 9.2.0 use IAppData
1209 1209
 	 */
1210 1210
 	public function getAppFolder() {
1211
-		$dir = '/' . \OC_App::getCurrentApp();
1211
+		$dir = '/'.\OC_App::getCurrentApp();
1212 1212
 		$root = $this->getRootFolder();
1213 1213
 		if (!$root->nodeExists($dir)) {
1214 1214
 			$folder = $root->newFolder($dir);
Please login to merge, or discard this patch.
lib/private/App/InfoParser.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 			return null;
50 50
 		}
51 51
 
52
-		if(!is_null($this->cache)) {
53
-			$fileCacheKey = $file . filemtime($file);
52
+		if (!is_null($this->cache)) {
53
+			$fileCacheKey = $file.filemtime($file);
54 54
 			if ($cachedValue = $this->cache->get($fileCacheKey)) {
55 55
 				return json_decode($cachedValue, true);
56 56
 			}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			$array['collaboration']['collaborators']['searchPlugins'] = $array['collaboration']['collaborators']['searchPlugins']['searchPlugin'];
173 173
 		}
174 174
 
175
-		if(!is_null($this->cache)) {
175
+		if (!is_null($this->cache)) {
176 176
 			$this->cache->set($fileCacheKey, json_encode($array));
177 177
 		}
178 178
 		return $array;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public function xmlToArray($xml) {
186 186
 		if (!$xml->children()) {
187
-			return (string)$xml;
187
+			return (string) $xml;
188 188
 		}
189 189
 
190 190
 		$array = [];
@@ -200,16 +200,16 @@  discard block
 block discarded – undo
200 200
 				$data = [
201 201
 					'@attributes' => [],
202 202
 				];
203
-				if (!count($node->children())){
204
-					$value = (string)$node;
203
+				if (!count($node->children())) {
204
+					$value = (string) $node;
205 205
 					if (!empty($value)) {
206
-						$data['@value'] = (string)$node;
206
+						$data['@value'] = (string) $node;
207 207
 					}
208 208
 				} else {
209 209
 					$data = array_merge($data, $this->xmlToArray($node));
210 210
 				}
211 211
 				foreach ($attributes as $attr => $value) {
212
-					$data['@attributes'][$attr] = (string)$value;
212
+					$data['@attributes'][$attr] = (string) $value;
213 213
 				}
214 214
 
215 215
 				if ($totalElement > 1) {
Please login to merge, or discard this patch.
lib/private/Collaboration/Collaborators/MailPlugin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 							if (!$searchResult->hasResult($userType, $cloud->getUser())) {
88 88
 								$singleResult = [[
89
-									'label' => $contact['FN'] . " ($emailAddress)",
89
+									'label' => $contact['FN']." ($emailAddress)",
90 90
 									'value' => [
91 91
 										'shareType' => Share::SHARE_TYPE_USER,
92 92
 										'shareWith' => $cloud->getUser(),
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 							if (!$searchResult->hasResult($userType, $cloud->getUser())) {
109 109
 								$singleResult = [[
110
-									'label' => $contact['FN'] . " ($emailAddress)",
110
+									'label' => $contact['FN']." ($emailAddress)",
111 111
 									'value' => [
112 112
 										'shareType' => Share::SHARE_TYPE_USER,
113 113
 										'shareWith' => $cloud->getUser(),
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 							$searchResult->markExactIdMatch($emailType);
125 125
 						}
126 126
 						$result['exact'][] = [
127
-							'label' => $contact['FN'] . " ($emailAddress)",
127
+							'label' => $contact['FN']." ($emailAddress)",
128 128
 							'value' => [
129 129
 								'shareType' => Share::SHARE_TYPE_EMAIL,
130 130
 								'shareWith' => $emailAddress,
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 						];
133 133
 					} else {
134 134
 						$result['wide'][] = [
135
-							'label' => $contact['FN'] . " ($emailAddress)",
135
+							'label' => $contact['FN']." ($emailAddress)",
136 136
 							'value' => [
137 137
 								'shareType' => Share::SHARE_TYPE_EMAIL,
138 138
 								'shareWith' => $emailAddress,
Please login to merge, or discard this patch.
lib/public/Collaboration/Collaborators/SearchResultType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@
 block discarded – undo
59 59
 	protected function getValidatedType($type) {
60 60
 		$type = trim(strval($type));
61 61
 
62
-		if($type === '') {
62
+		if ($type === '') {
63 63
 			throw new \InvalidArgumentException('Type must not be empty');
64 64
 		}
65 65
 
66
-		if($type === 'exact') {
66
+		if ($type === 'exact') {
67 67
 			throw new \InvalidArgumentException('Provided type is a reserved word');
68 68
 		}
69 69
 
Please login to merge, or discard this patch.
lib/private/Collaboration/Collaborators/SearchResult.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 
38 38
 	public function addResultSet(SearchResultType $type, array $matches, array $exactMatches = null) {
39 39
 		$type = $type->getLabel();
40
-		if(!isset($this->result[$type])) {
40
+		if (!isset($this->result[$type])) {
41 41
 			$this->result[$type] = [];
42 42
 			$this->result['exact'][$type] = [];
43 43
 		}
44 44
 
45 45
 		$this->result[$type] = array_merge($this->result[$type], $matches);
46
-		if(is_array($exactMatches)) {
46
+		if (is_array($exactMatches)) {
47 47
 			$this->result['exact'][$type] = array_merge($this->result['exact'][$type], $exactMatches);
48 48
 		}
49 49
 	}
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function hasResult(SearchResultType $type, $collaboratorId) {
60 60
 		$type = $type->getLabel();
61
-		if(!isset($this->result[$type])) {
61
+		if (!isset($this->result[$type])) {
62 62
 			return false;
63 63
 		}
64 64
 
65 65
 		$resultArrays = [$this->result['exact'][$type], $this->result[$type]];
66
-		foreach($resultArrays as $resultArray) {
66
+		foreach ($resultArrays as $resultArray) {
67 67
 			if ($resultArray['value']['shareWith'] === $collaboratorId) {
68 68
 				return true;
69 69
 			}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	public function unsetResult(SearchResultType $type) {
80 80
 		$type = $type->getLabel();
81 81
 		$this->result[$type] = [];
82
-		if(isset($this->result['exact'][$type])) {
82
+		if (isset($this->result['exact'][$type])) {
83 83
 			$this->result['exact'][$type] = [];
84 84
 		}
85 85
 	}
Please login to merge, or discard this patch.
lib/private/Collaboration/Collaborators/RemotePlugin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 							$searchResult->markExactIdMatch($resultType);
80 80
 						}
81 81
 						$result['exact'][] = [
82
-							'label' => $contact['FN'] . " ($cloudId)",
82
+							'label' => $contact['FN']." ($cloudId)",
83 83
 							'value' => [
84 84
 								'shareType' => Share::SHARE_TYPE_REMOTE,
85 85
 								'shareWith' => $cloudId,
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 						];
89 89
 					} else {
90 90
 						$result['wide'][] = [
91
-							'label' => $contact['FN'] . " ($cloudId)",
91
+							'label' => $contact['FN']." ($cloudId)",
92 92
 							'value' => [
93 93
 								'shareType' => Share::SHARE_TYPE_REMOTE,
94 94
 								'shareWith' => $cloudId,
Please login to merge, or discard this patch.
apps/files_sharing/lib/Controller/ShareesAPIController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -117,13 +117,13 @@  discard block
 block discarded – undo
117 117
 	public function search($search = '', $itemType = null, $page = 1, $perPage = 200, $shareType = null, $lookup = true) {
118 118
 
119 119
 		// only search for string larger than a given threshold
120
-		$threshold = (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0);
120
+		$threshold = (int) $this->config->getSystemValue('sharing.minSearchStringLength', 0);
121 121
 		if (strlen($search) < $threshold) {
122 122
 			return new DataResponse($this->result);
123 123
 		}
124 124
 
125 125
 		// never return more than the max. number of results configured in the config.php
126
-		$maxResults = (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0);
126
+		$maxResults = (int) $this->config->getSystemValue('sharing.maxAutocompleteResults', 0);
127 127
 		if ($maxResults > 0) {
128 128
 			$perPage = min($perPage, $maxResults);
129 129
 		}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		list($result, $hasMoreResults) = $this->collaboratorSearch->search($search, $shareTypes, $lookup, $this->limit, $this->offset);
179 179
 
180 180
 		// extra treatment for 'exact' subarray, with a single merge expected keys might be lost
181
-		if(isset($result['exact'])) {
181
+		if (isset($result['exact'])) {
182 182
 			$result['exact'] = array_merge($this->result['exact'], $result['exact']);
183 183
 		}
184 184
 		$this->result = array_merge($this->result, $result);
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
 	 */
223 223
 	protected function getPaginationLink($page, array $params) {
224 224
 		if ($this->isV2()) {
225
-			$url = $this->urlGenerator->getAbsoluteURL('/ocs/v2.php/apps/files_sharing/api/v1/sharees') . '?';
225
+			$url = $this->urlGenerator->getAbsoluteURL('/ocs/v2.php/apps/files_sharing/api/v1/sharees').'?';
226 226
 		} else {
227
-			$url = $this->urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/sharees') . '?';
227
+			$url = $this->urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/sharees').'?';
228 228
 		}
229 229
 		$params['page'] = $page + 1;
230
-		$link = '<' . $url . http_build_query($params) . '>; rel="next"';
230
+		$link = '<'.$url.http_build_query($params).'>; rel="next"';
231 231
 
232 232
 		return $link;
233 233
 	}
Please login to merge, or discard this patch.