@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | // To find out if we are running from CLI or not |
182 | 182 | $this->registerParameter('isCLI', \OC::$CLI); |
183 | 183 | |
184 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
184 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
185 | 185 | return $c; |
186 | 186 | }); |
187 | 187 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
201 | 201 | |
202 | 202 | |
203 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
203 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
204 | 204 | return new PreviewManager( |
205 | 205 | $c->getConfig(), |
206 | 206 | $c->getRootFolder(), |
@@ -211,13 +211,13 @@ discard block |
||
211 | 211 | }); |
212 | 212 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
213 | 213 | |
214 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
214 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
215 | 215 | return new \OC\Preview\Watcher( |
216 | 216 | $c->getAppDataDir('preview') |
217 | 217 | ); |
218 | 218 | }); |
219 | 219 | |
220 | - $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
220 | + $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
|
221 | 221 | $view = new View(); |
222 | 222 | $util = new Encryption\Util( |
223 | 223 | $view, |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | }); |
237 | 237 | $this->registerAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
238 | 238 | |
239 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
239 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
240 | 240 | $util = new Encryption\Util( |
241 | 241 | new View(), |
242 | 242 | $c->getUserManager(), |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | ); |
251 | 251 | }); |
252 | 252 | |
253 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
253 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
254 | 254 | $view = new View(); |
255 | 255 | $util = new Encryption\Util( |
256 | 256 | $view, |
@@ -261,30 +261,30 @@ discard block |
||
261 | 261 | |
262 | 262 | return new Encryption\Keys\Storage($view, $util); |
263 | 263 | }); |
264 | - $this->registerService('TagMapper', function (Server $c) { |
|
264 | + $this->registerService('TagMapper', function(Server $c) { |
|
265 | 265 | return new TagMapper($c->getDatabaseConnection()); |
266 | 266 | }); |
267 | 267 | |
268 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
268 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
269 | 269 | $tagMapper = $c->query('TagMapper'); |
270 | 270 | return new TagManager($tagMapper, $c->getUserSession()); |
271 | 271 | }); |
272 | 272 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
273 | 273 | |
274 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
274 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
275 | 275 | $config = $c->getConfig(); |
276 | 276 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
277 | 277 | return new $factoryClass($this); |
278 | 278 | }); |
279 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
279 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
280 | 280 | return $c->query('SystemTagManagerFactory')->getManager(); |
281 | 281 | }); |
282 | 282 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
283 | 283 | |
284 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
284 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
285 | 285 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
286 | 286 | }); |
287 | - $this->registerService('RootFolder', function (Server $c) { |
|
287 | + $this->registerService('RootFolder', function(Server $c) { |
|
288 | 288 | $manager = \OC\Files\Filesystem::getMountManager(null); |
289 | 289 | $view = new View(); |
290 | 290 | $root = new Root( |
@@ -305,38 +305,38 @@ discard block |
||
305 | 305 | }); |
306 | 306 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
307 | 307 | |
308 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
309 | - return new LazyRoot(function () use ($c) { |
|
308 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
309 | + return new LazyRoot(function() use ($c) { |
|
310 | 310 | return $c->query('RootFolder'); |
311 | 311 | }); |
312 | 312 | }); |
313 | 313 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
314 | 314 | |
315 | - $this->registerService(\OC\User\Manager::class, function (Server $c) { |
|
315 | + $this->registerService(\OC\User\Manager::class, function(Server $c) { |
|
316 | 316 | $config = $c->getConfig(); |
317 | 317 | return new \OC\User\Manager($config); |
318 | 318 | }); |
319 | 319 | $this->registerAlias('UserManager', \OC\User\Manager::class); |
320 | 320 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
321 | 321 | |
322 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
322 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
323 | 323 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
324 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
324 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
325 | 325 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
326 | 326 | }); |
327 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
327 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
328 | 328 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
329 | 329 | }); |
330 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
330 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
331 | 331 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
332 | 332 | }); |
333 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
333 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
334 | 334 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
335 | 335 | }); |
336 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
336 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
337 | 337 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
338 | 338 | }); |
339 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
339 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
340 | 340 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
341 | 341 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
342 | 342 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | }); |
346 | 346 | $this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
347 | 347 | |
348 | - $this->registerService(Store::class, function (Server $c) { |
|
348 | + $this->registerService(Store::class, function(Server $c) { |
|
349 | 349 | $session = $c->getSession(); |
350 | 350 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
351 | 351 | $tokenProvider = $c->query(IProvider::class); |
@@ -356,13 +356,13 @@ discard block |
||
356 | 356 | return new Store($session, $logger, $tokenProvider); |
357 | 357 | }); |
358 | 358 | $this->registerAlias(IStore::class, Store::class); |
359 | - $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
359 | + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
360 | 360 | $dbConnection = $c->getDatabaseConnection(); |
361 | 361 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
362 | 362 | }); |
363 | 363 | $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
364 | 364 | |
365 | - $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
365 | + $this->registerService(\OC\User\Session::class, function(Server $c) { |
|
366 | 366 | $manager = $c->getUserManager(); |
367 | 367 | $session = new \OC\Session\Memory(''); |
368 | 368 | $timeFactory = new TimeFactory(); |
@@ -386,45 +386,45 @@ discard block |
||
386 | 386 | $c->getLockdownManager(), |
387 | 387 | $c->getLogger() |
388 | 388 | ); |
389 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
389 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
390 | 390 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
391 | 391 | }); |
392 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
392 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
393 | 393 | /** @var $user \OC\User\User */ |
394 | 394 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
395 | 395 | }); |
396 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
396 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
397 | 397 | /** @var $user \OC\User\User */ |
398 | 398 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
399 | 399 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
400 | 400 | }); |
401 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
401 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
402 | 402 | /** @var $user \OC\User\User */ |
403 | 403 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
404 | 404 | }); |
405 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
405 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
406 | 406 | /** @var $user \OC\User\User */ |
407 | 407 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
408 | 408 | }); |
409 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
409 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
410 | 410 | /** @var $user \OC\User\User */ |
411 | 411 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
412 | 412 | }); |
413 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
413 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
414 | 414 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
415 | 415 | }); |
416 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
416 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
417 | 417 | /** @var $user \OC\User\User */ |
418 | 418 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
419 | 419 | }); |
420 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
420 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
421 | 421 | /** @var $user \OC\User\User */ |
422 | 422 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
423 | 423 | }); |
424 | - $userSession->listen('\OC\User', 'logout', function () { |
|
424 | + $userSession->listen('\OC\User', 'logout', function() { |
|
425 | 425 | \OC_Hook::emit('OC_User', 'logout', array()); |
426 | 426 | }); |
427 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
427 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
428 | 428 | /** @var $user \OC\User\User */ |
429 | 429 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
430 | 430 | $dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value])); |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
440 | 440 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
441 | 441 | |
442 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
442 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
443 | 443 | return new \OC\AllConfig( |
444 | 444 | $c->getSystemConfig() |
445 | 445 | ); |
@@ -447,17 +447,17 @@ discard block |
||
447 | 447 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
448 | 448 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
449 | 449 | |
450 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
450 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
451 | 451 | return new \OC\SystemConfig($config); |
452 | 452 | }); |
453 | 453 | |
454 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
454 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
455 | 455 | return new \OC\AppConfig($c->getDatabaseConnection()); |
456 | 456 | }); |
457 | 457 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
458 | 458 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
459 | 459 | |
460 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
460 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
461 | 461 | return new \OC\L10N\Factory( |
462 | 462 | $c->getConfig(), |
463 | 463 | $c->getRequest(), |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | }); |
468 | 468 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
469 | 469 | |
470 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
470 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
471 | 471 | $config = $c->getConfig(); |
472 | 472 | $cacheFactory = $c->getMemCacheFactory(); |
473 | 473 | $request = $c->getRequest(); |
@@ -482,12 +482,12 @@ discard block |
||
482 | 482 | $this->registerAlias('AppFetcher', AppFetcher::class); |
483 | 483 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
484 | 484 | |
485 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
485 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
486 | 486 | return new Cache\File(); |
487 | 487 | }); |
488 | 488 | $this->registerAlias('UserCache', \OCP\ICache::class); |
489 | 489 | |
490 | - $this->registerService(Factory::class, function (Server $c) { |
|
490 | + $this->registerService(Factory::class, function(Server $c) { |
|
491 | 491 | |
492 | 492 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
493 | 493 | ArrayCache::class, |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $version = implode(',', $v); |
505 | 505 | $instanceId = \OC_Util::getInstanceId(); |
506 | 506 | $path = \OC::$SERVERROOT; |
507 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
507 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
508 | 508 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
509 | 509 | $config->getSystemValue('memcache.local', null), |
510 | 510 | $config->getSystemValue('memcache.distributed', null), |
@@ -517,12 +517,12 @@ discard block |
||
517 | 517 | $this->registerAlias('MemCacheFactory', Factory::class); |
518 | 518 | $this->registerAlias(ICacheFactory::class, Factory::class); |
519 | 519 | |
520 | - $this->registerService('RedisFactory', function (Server $c) { |
|
520 | + $this->registerService('RedisFactory', function(Server $c) { |
|
521 | 521 | $systemConfig = $c->getSystemConfig(); |
522 | 522 | return new RedisFactory($systemConfig); |
523 | 523 | }); |
524 | 524 | |
525 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
525 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
526 | 526 | return new \OC\Activity\Manager( |
527 | 527 | $c->getRequest(), |
528 | 528 | $c->getUserSession(), |
@@ -532,14 +532,14 @@ discard block |
||
532 | 532 | }); |
533 | 533 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
534 | 534 | |
535 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
535 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
536 | 536 | return new \OC\Activity\EventMerger( |
537 | 537 | $c->getL10N('lib') |
538 | 538 | ); |
539 | 539 | }); |
540 | 540 | $this->registerAlias(IValidator::class, Validator::class); |
541 | 541 | |
542 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
542 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
543 | 543 | return new AvatarManager( |
544 | 544 | $c->query(\OC\User\Manager::class), |
545 | 545 | $c->getAppDataDir('avatar'), |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | |
553 | 553 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
554 | 554 | |
555 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
555 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
556 | 556 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
557 | 557 | $factory = new LogFactory($c, $this->getSystemConfig()); |
558 | 558 | $logger = $factory->get($logType); |
@@ -562,11 +562,11 @@ discard block |
||
562 | 562 | }); |
563 | 563 | $this->registerAlias('Logger', \OCP\ILogger::class); |
564 | 564 | |
565 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
565 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
566 | 566 | return new LogFactory($c, $this->getSystemConfig()); |
567 | 567 | }); |
568 | 568 | |
569 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
569 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
570 | 570 | $config = $c->getConfig(); |
571 | 571 | return new \OC\BackgroundJob\JobList( |
572 | 572 | $c->getDatabaseConnection(), |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | }); |
577 | 577 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
578 | 578 | |
579 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
579 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
580 | 580 | $cacheFactory = $c->getMemCacheFactory(); |
581 | 581 | $logger = $c->getLogger(); |
582 | 582 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -588,12 +588,12 @@ discard block |
||
588 | 588 | }); |
589 | 589 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
590 | 590 | |
591 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
591 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
592 | 592 | return new Search(); |
593 | 593 | }); |
594 | 594 | $this->registerAlias('Search', \OCP\ISearch::class); |
595 | 595 | |
596 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) { |
|
596 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) { |
|
597 | 597 | return new \OC\Security\RateLimiting\Limiter( |
598 | 598 | $this->getUserSession(), |
599 | 599 | $this->getRequest(), |
@@ -601,34 +601,34 @@ discard block |
||
601 | 601 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
602 | 602 | ); |
603 | 603 | }); |
604 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
604 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
605 | 605 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
606 | 606 | $this->getMemCacheFactory(), |
607 | 607 | new \OC\AppFramework\Utility\TimeFactory() |
608 | 608 | ); |
609 | 609 | }); |
610 | 610 | |
611 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
611 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
612 | 612 | return new SecureRandom(); |
613 | 613 | }); |
614 | 614 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
615 | 615 | |
616 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
616 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
617 | 617 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
618 | 618 | }); |
619 | 619 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
620 | 620 | |
621 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
621 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
622 | 622 | return new Hasher($c->getConfig()); |
623 | 623 | }); |
624 | 624 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
625 | 625 | |
626 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
626 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
627 | 627 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
628 | 628 | }); |
629 | 629 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
630 | 630 | |
631 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
631 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
632 | 632 | $systemConfig = $c->getSystemConfig(); |
633 | 633 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
634 | 634 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
644 | 644 | |
645 | 645 | |
646 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
646 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
647 | 647 | $user = \OC_User::getUser(); |
648 | 648 | $uid = $user ? $user : null; |
649 | 649 | return new ClientService( |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | ); |
659 | 659 | }); |
660 | 660 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
661 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
661 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
662 | 662 | $eventLogger = new EventLogger(); |
663 | 663 | if ($c->getSystemConfig()->getValue('debug', false)) { |
664 | 664 | // In debug mode, module is being activated by default |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | }); |
669 | 669 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
670 | 670 | |
671 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
671 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
672 | 672 | $queryLogger = new QueryLogger(); |
673 | 673 | if ($c->getSystemConfig()->getValue('debug', false)) { |
674 | 674 | // In debug mode, module is being activated by default |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | }); |
679 | 679 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
680 | 680 | |
681 | - $this->registerService(TempManager::class, function (Server $c) { |
|
681 | + $this->registerService(TempManager::class, function(Server $c) { |
|
682 | 682 | return new TempManager( |
683 | 683 | $c->getLogger(), |
684 | 684 | $c->getConfig() |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | $this->registerAlias('TempManager', TempManager::class); |
688 | 688 | $this->registerAlias(ITempManager::class, TempManager::class); |
689 | 689 | |
690 | - $this->registerService(AppManager::class, function (Server $c) { |
|
690 | + $this->registerService(AppManager::class, function(Server $c) { |
|
691 | 691 | return new \OC\App\AppManager( |
692 | 692 | $c->getUserSession(), |
693 | 693 | $c->query(\OC\AppConfig::class), |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | $this->registerAlias('AppManager', AppManager::class); |
700 | 700 | $this->registerAlias(IAppManager::class, AppManager::class); |
701 | 701 | |
702 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
702 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
703 | 703 | return new DateTimeZone( |
704 | 704 | $c->getConfig(), |
705 | 705 | $c->getSession() |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | }); |
708 | 708 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
709 | 709 | |
710 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
710 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
711 | 711 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
712 | 712 | |
713 | 713 | return new DateTimeFormatter( |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | }); |
718 | 718 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
719 | 719 | |
720 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
720 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
721 | 721 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
722 | 722 | $listener = new UserMountCacheListener($mountCache); |
723 | 723 | $listener->listen($c->getUserManager()); |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | }); |
726 | 726 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
727 | 727 | |
728 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
728 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
729 | 729 | $loader = \OC\Files\Filesystem::getLoader(); |
730 | 730 | $mountCache = $c->query('UserMountCache'); |
731 | 731 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -741,10 +741,10 @@ discard block |
||
741 | 741 | }); |
742 | 742 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
743 | 743 | |
744 | - $this->registerService('IniWrapper', function ($c) { |
|
744 | + $this->registerService('IniWrapper', function($c) { |
|
745 | 745 | return new IniGetWrapper(); |
746 | 746 | }); |
747 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
747 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
748 | 748 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
749 | 749 | if ($busClass) { |
750 | 750 | list($app, $class) = explode('::', $busClass, 2); |
@@ -759,10 +759,10 @@ discard block |
||
759 | 759 | return new CronBus($jobList); |
760 | 760 | } |
761 | 761 | }); |
762 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
762 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
763 | 763 | return new TrustedDomainHelper($this->getConfig()); |
764 | 764 | }); |
765 | - $this->registerService(Throttler::class, function (Server $c) { |
|
765 | + $this->registerService(Throttler::class, function(Server $c) { |
|
766 | 766 | return new Throttler( |
767 | 767 | $c->getDatabaseConnection(), |
768 | 768 | new TimeFactory(), |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | ); |
772 | 772 | }); |
773 | 773 | $this->registerAlias('Throttler', Throttler::class); |
774 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
774 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
775 | 775 | // IConfig and IAppManager requires a working database. This code |
776 | 776 | // might however be called when ownCloud is not yet setup. |
777 | 777 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | $c->getTempManager() |
793 | 793 | ); |
794 | 794 | }); |
795 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
795 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
796 | 796 | if (isset($this['urlParams'])) { |
797 | 797 | $urlParams = $this['urlParams']; |
798 | 798 | } else { |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | }); |
829 | 829 | $this->registerAlias('Request', \OCP\IRequest::class); |
830 | 830 | |
831 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
831 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
832 | 832 | return new Mailer( |
833 | 833 | $c->getConfig(), |
834 | 834 | $c->getLogger(), |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | }); |
840 | 840 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
841 | 841 | |
842 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
842 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
843 | 843 | $config = $c->getConfig(); |
844 | 844 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
845 | 845 | if (is_null($factoryClass)) { |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | $factory = new $factoryClass($this); |
850 | 850 | return $factory->getLDAPProvider(); |
851 | 851 | }); |
852 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
852 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
853 | 853 | $ini = $c->getIniWrapper(); |
854 | 854 | $config = $c->getConfig(); |
855 | 855 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -872,49 +872,49 @@ discard block |
||
872 | 872 | }); |
873 | 873 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
874 | 874 | |
875 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
875 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
876 | 876 | return new \OC\Files\Mount\Manager(); |
877 | 877 | }); |
878 | 878 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
879 | 879 | |
880 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
880 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
881 | 881 | return new \OC\Files\Type\Detection( |
882 | 882 | $c->getURLGenerator(), |
883 | 883 | \OC::$configDir, |
884 | - \OC::$SERVERROOT . '/resources/config/' |
|
884 | + \OC::$SERVERROOT.'/resources/config/' |
|
885 | 885 | ); |
886 | 886 | }); |
887 | 887 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
888 | 888 | |
889 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
889 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
890 | 890 | return new \OC\Files\Type\Loader( |
891 | 891 | $c->getDatabaseConnection() |
892 | 892 | ); |
893 | 893 | }); |
894 | 894 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
895 | - $this->registerService(BundleFetcher::class, function () { |
|
895 | + $this->registerService(BundleFetcher::class, function() { |
|
896 | 896 | return new BundleFetcher($this->getL10N('lib')); |
897 | 897 | }); |
898 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
898 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
899 | 899 | return new Manager( |
900 | 900 | $c->query(IValidator::class) |
901 | 901 | ); |
902 | 902 | }); |
903 | 903 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
904 | 904 | |
905 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
905 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
906 | 906 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
907 | - $manager->registerCapability(function () use ($c) { |
|
907 | + $manager->registerCapability(function() use ($c) { |
|
908 | 908 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
909 | 909 | }); |
910 | - $manager->registerCapability(function () use ($c) { |
|
910 | + $manager->registerCapability(function() use ($c) { |
|
911 | 911 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
912 | 912 | }); |
913 | 913 | return $manager; |
914 | 914 | }); |
915 | 915 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
916 | 916 | |
917 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
917 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
918 | 918 | $config = $c->getConfig(); |
919 | 919 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
920 | 920 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
925 | 925 | $manager = $c->getUserManager(); |
926 | 926 | $user = $manager->get($id); |
927 | - if(is_null($user)) { |
|
927 | + if (is_null($user)) { |
|
928 | 928 | $l = $c->getL10N('core'); |
929 | 929 | $displayName = $l->t('Unknown user'); |
930 | 930 | } else { |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | }); |
938 | 938 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
939 | 939 | |
940 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
940 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
941 | 941 | /* |
942 | 942 | * Dark magic for autoloader. |
943 | 943 | * If we do a class_exists it will try to load the class which will |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | } |
965 | 965 | return new \OC_Defaults(); |
966 | 966 | }); |
967 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
967 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
968 | 968 | /** @var Factory $cacheFactory */ |
969 | 969 | $cacheFactory = $c->query(Factory::class); |
970 | 970 | return new SCSSCacher( |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | new TimeFactory() |
980 | 980 | ); |
981 | 981 | }); |
982 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
982 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
983 | 983 | /** @var Factory $cacheFactory */ |
984 | 984 | $cacheFactory = $c->query(Factory::class); |
985 | 985 | return new JSCombiner( |
@@ -990,13 +990,13 @@ discard block |
||
990 | 990 | $c->getLogger() |
991 | 991 | ); |
992 | 992 | }); |
993 | - $this->registerService(EventDispatcher::class, function () { |
|
993 | + $this->registerService(EventDispatcher::class, function() { |
|
994 | 994 | return new EventDispatcher(); |
995 | 995 | }); |
996 | 996 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
997 | 997 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
998 | 998 | |
999 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
999 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
1000 | 1000 | // FIXME: Instantiiated here due to cyclic dependency |
1001 | 1001 | $request = new Request( |
1002 | 1002 | [ |
@@ -1021,7 +1021,7 @@ discard block |
||
1021 | 1021 | $request |
1022 | 1022 | ); |
1023 | 1023 | }); |
1024 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
1024 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
1025 | 1025 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
1026 | 1026 | |
1027 | 1027 | return new CsrfTokenManager( |
@@ -1029,22 +1029,22 @@ discard block |
||
1029 | 1029 | $c->query(SessionStorage::class) |
1030 | 1030 | ); |
1031 | 1031 | }); |
1032 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
1032 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
1033 | 1033 | return new SessionStorage($c->getSession()); |
1034 | 1034 | }); |
1035 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
1035 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
1036 | 1036 | return new ContentSecurityPolicyManager(); |
1037 | 1037 | }); |
1038 | 1038 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
1039 | 1039 | |
1040 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
1040 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
1041 | 1041 | return new ContentSecurityPolicyNonceManager( |
1042 | 1042 | $c->getCsrfTokenManager(), |
1043 | 1043 | $c->getRequest() |
1044 | 1044 | ); |
1045 | 1045 | }); |
1046 | 1046 | |
1047 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
1047 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1048 | 1048 | $config = $c->getConfig(); |
1049 | 1049 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1050 | 1050 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1089,7 +1089,7 @@ discard block |
||
1089 | 1089 | |
1090 | 1090 | $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); |
1091 | 1091 | |
1092 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1092 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1093 | 1093 | $manager = new \OC\Settings\Manager( |
1094 | 1094 | $c->getLogger(), |
1095 | 1095 | $c->getL10N('lib'), |
@@ -1098,36 +1098,36 @@ discard block |
||
1098 | 1098 | ); |
1099 | 1099 | return $manager; |
1100 | 1100 | }); |
1101 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1101 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1102 | 1102 | return new \OC\Files\AppData\Factory( |
1103 | 1103 | $c->getRootFolder(), |
1104 | 1104 | $c->getSystemConfig() |
1105 | 1105 | ); |
1106 | 1106 | }); |
1107 | 1107 | |
1108 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1109 | - return new LockdownManager(function () use ($c) { |
|
1108 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1109 | + return new LockdownManager(function() use ($c) { |
|
1110 | 1110 | return $c->getSession(); |
1111 | 1111 | }); |
1112 | 1112 | }); |
1113 | 1113 | |
1114 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1114 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1115 | 1115 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1116 | 1116 | }); |
1117 | 1117 | |
1118 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1118 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1119 | 1119 | return new CloudIdManager(); |
1120 | 1120 | }); |
1121 | 1121 | |
1122 | - $this->registerService(IConfig::class, function (Server $c) { |
|
1122 | + $this->registerService(IConfig::class, function(Server $c) { |
|
1123 | 1123 | return new GlobalScale\Config($c->getConfig()); |
1124 | 1124 | }); |
1125 | 1125 | |
1126 | - $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
1126 | + $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1127 | 1127 | return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
1128 | 1128 | }); |
1129 | 1129 | |
1130 | - $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1130 | + $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1131 | 1131 | return new CloudFederationFactory(); |
1132 | 1132 | }); |
1133 | 1133 | |
@@ -1137,18 +1137,18 @@ discard block |
||
1137 | 1137 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1138 | 1138 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1139 | 1139 | |
1140 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1140 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1141 | 1141 | return new Defaults( |
1142 | 1142 | $c->getThemingDefaults() |
1143 | 1143 | ); |
1144 | 1144 | }); |
1145 | 1145 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
1146 | 1146 | |
1147 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1147 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1148 | 1148 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1149 | 1149 | }); |
1150 | 1150 | |
1151 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1151 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1152 | 1152 | return new ShareHelper( |
1153 | 1153 | $c->query(\OCP\Share\IManager::class) |
1154 | 1154 | ); |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | $this->registerAlias(IDashboardManager::class, DashboardManager::class); |
1192 | 1192 | $this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class); |
1193 | 1193 | |
1194 | - $this->registerService(\OC\Security\IdentityProof\Manager::class, function (Server $c) { |
|
1194 | + $this->registerService(\OC\Security\IdentityProof\Manager::class, function(Server $c) { |
|
1195 | 1195 | return new \OC\Security\IdentityProof\Manager( |
1196 | 1196 | $c->query(\OC\Files\AppData\Factory::class), |
1197 | 1197 | $c->getCrypto(), |
@@ -1240,11 +1240,11 @@ discard block |
||
1240 | 1240 | // no avatar to remove |
1241 | 1241 | } catch (\Exception $e) { |
1242 | 1242 | // Ignore exceptions |
1243 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1243 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1244 | 1244 | } |
1245 | 1245 | }); |
1246 | 1246 | |
1247 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1247 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1248 | 1248 | $manager = $this->getAvatarManager(); |
1249 | 1249 | /** @var IUser $user */ |
1250 | 1250 | $user = $e->getSubject(); |
@@ -1395,7 +1395,7 @@ discard block |
||
1395 | 1395 | * @deprecated since 9.2.0 use IAppData |
1396 | 1396 | */ |
1397 | 1397 | public function getAppFolder() { |
1398 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1398 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1399 | 1399 | $root = $this->getRootFolder(); |
1400 | 1400 | if (!$root->nodeExists($dir)) { |
1401 | 1401 | $folder = $root->newFolder($dir); |
@@ -1970,7 +1970,7 @@ discard block |
||
1970 | 1970 | /** |
1971 | 1971 | * @return \OCP\Collaboration\AutoComplete\IManager |
1972 | 1972 | */ |
1973 | - public function getAutoCompleteManager(){ |
|
1973 | + public function getAutoCompleteManager() { |
|
1974 | 1974 | return $this->query(IManager::class); |
1975 | 1975 | } |
1976 | 1976 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @param array $urlParams |
81 | 81 | * @param ServerContainer|null $server |
82 | 82 | */ |
83 | - public function __construct($appName, $urlParams = array(), ServerContainer $server = null){ |
|
83 | + public function __construct($appName, $urlParams = array(), ServerContainer $server = null) { |
|
84 | 84 | parent::__construct(); |
85 | 85 | $this['AppName'] = $appName; |
86 | 86 | $this['urlParams'] = $urlParams; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * Core services |
104 | 104 | */ |
105 | - $this->registerService(IOutput::class, function($c){ |
|
105 | + $this->registerService(IOutput::class, function($c) { |
|
106 | 106 | return new Output($this->getServer()->getWebRoot()); |
107 | 107 | }); |
108 | 108 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | return $this->getServer()->getUserFolder(); |
111 | 111 | }); |
112 | 112 | |
113 | - $this->registerService(IAppData::class, function (SimpleContainer $c) { |
|
113 | + $this->registerService(IAppData::class, function(SimpleContainer $c) { |
|
114 | 114 | return $this->getServer()->getAppDataDir($c->query('AppName')); |
115 | 115 | }); |
116 | 116 | |
@@ -119,41 +119,41 @@ discard block |
||
119 | 119 | }); |
120 | 120 | |
121 | 121 | // Log wrapper |
122 | - $this->registerService(ILogger::class, function ($c) { |
|
122 | + $this->registerService(ILogger::class, function($c) { |
|
123 | 123 | return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->query('AppName')); |
124 | 124 | }); |
125 | 125 | |
126 | - $this->registerService(IServerContainer::class, function ($c) { |
|
126 | + $this->registerService(IServerContainer::class, function($c) { |
|
127 | 127 | return $this->getServer(); |
128 | 128 | }); |
129 | 129 | $this->registerAlias('ServerContainer', IServerContainer::class); |
130 | 130 | |
131 | - $this->registerService(\OCP\WorkflowEngine\IManager::class, function ($c) { |
|
131 | + $this->registerService(\OCP\WorkflowEngine\IManager::class, function($c) { |
|
132 | 132 | return $c->query(Manager::class); |
133 | 133 | }); |
134 | 134 | |
135 | - $this->registerService(\OCP\AppFramework\IAppContainer::class, function ($c) { |
|
135 | + $this->registerService(\OCP\AppFramework\IAppContainer::class, function($c) { |
|
136 | 136 | return $c; |
137 | 137 | }); |
138 | 138 | |
139 | 139 | // commonly used attributes |
140 | - $this->registerService('UserId', function ($c) { |
|
140 | + $this->registerService('UserId', function($c) { |
|
141 | 141 | return $c->query(IUserSession::class)->getSession()->get('user_id'); |
142 | 142 | }); |
143 | 143 | |
144 | - $this->registerService('WebRoot', function ($c) { |
|
144 | + $this->registerService('WebRoot', function($c) { |
|
145 | 145 | return $c->query('ServerContainer')->getWebRoot(); |
146 | 146 | }); |
147 | 147 | |
148 | - $this->registerService('OC_Defaults', function ($c) { |
|
148 | + $this->registerService('OC_Defaults', function($c) { |
|
149 | 149 | return $c->getServer()->getThemingDefaults(); |
150 | 150 | }); |
151 | 151 | |
152 | - $this->registerService(IConfig::class, function ($c) { |
|
152 | + $this->registerService(IConfig::class, function($c) { |
|
153 | 153 | return $c->query(OC\GlobalScale\Config::class); |
154 | 154 | }); |
155 | 155 | |
156 | - $this->registerService('Protocol', function($c){ |
|
156 | + $this->registerService('Protocol', function($c) { |
|
157 | 157 | /** @var \OC\Server $server */ |
158 | 158 | $server = $c->query('ServerContainer'); |
159 | 159 | $protocol = $server->getRequest()->getHttpProtocol(); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | ); |
202 | 202 | }); |
203 | 203 | |
204 | - $this->registerService(OC\AppFramework\Middleware\Security\PasswordConfirmationMiddleware::class, function ($c) use ($app) { |
|
204 | + $this->registerService(OC\AppFramework\Middleware\Security\PasswordConfirmationMiddleware::class, function($c) use ($app) { |
|
205 | 205 | /** @var \OC\Server $server */ |
206 | 206 | $server = $app->getServer(); |
207 | 207 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | ); |
254 | 254 | }); |
255 | 255 | |
256 | - $this->registerService('TwoFactorMiddleware', function (SimpleContainer $c) use ($app) { |
|
256 | + $this->registerService('TwoFactorMiddleware', function(SimpleContainer $c) use ($app) { |
|
257 | 257 | $twoFactorManager = $c->getServer()->getTwoFactorAuthManager(); |
258 | 258 | $userSession = $app->getServer()->getUserSession(); |
259 | 259 | $session = $app->getServer()->getSession(); |
@@ -263,13 +263,13 @@ discard block |
||
263 | 263 | return new TwoFactorMiddleware($twoFactorManager, $userSession, $session, $urlGenerator, $reflector, $request); |
264 | 264 | }); |
265 | 265 | |
266 | - $this->registerService('OCSMiddleware', function (SimpleContainer $c) { |
|
266 | + $this->registerService('OCSMiddleware', function(SimpleContainer $c) { |
|
267 | 267 | return new OCSMiddleware( |
268 | 268 | $c['Request'] |
269 | 269 | ); |
270 | 270 | }); |
271 | 271 | |
272 | - $this->registerService(OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware::class, function (SimpleContainer $c) { |
|
272 | + $this->registerService(OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware::class, function(SimpleContainer $c) { |
|
273 | 273 | return new OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware( |
274 | 274 | $c['Request'], |
275 | 275 | $c->query(IControllerMethodReflector::class) |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | $c->query(\OCP\IConfig::class) |
294 | 294 | )); |
295 | 295 | |
296 | - foreach($middleWares as $middleWare) { |
|
296 | + foreach ($middleWares as $middleWare) { |
|
297 | 297 | $dispatcher->registerMiddleware($c[$middleWare]); |
298 | 298 | } |
299 | 299 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | * @return mixed |
356 | 356 | */ |
357 | 357 | public function log($message, $level) { |
358 | - switch($level){ |
|
358 | + switch ($level) { |
|
359 | 359 | case 'debug': |
360 | 360 | $level = ILogger::DEBUG; |
361 | 361 | break; |
@@ -421,12 +421,12 @@ discard block |
||
421 | 421 | return parent::query($name); |
422 | 422 | } else if ($this['AppName'] === 'core' && strpos($name, 'OC\\Core\\') === 0) { |
423 | 423 | return parent::query($name); |
424 | - } else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']) . '\\') === 0) { |
|
424 | + } else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']).'\\') === 0) { |
|
425 | 425 | return parent::query($name); |
426 | 426 | } |
427 | 427 | } |
428 | 428 | |
429 | - throw new QueryException('Could not resolve ' . $name . '!' . |
|
429 | + throw new QueryException('Could not resolve '.$name.'!'. |
|
430 | 430 | ' Class can not be instantiated', 1); |
431 | 431 | } |
432 | 432 | } |