@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | |
46 | 46 | $config->expects($this->any()) |
47 | 47 | ->method('getValue') |
48 | - ->willReturnCallback(function ($app, $key, $default) use (&$appConfig) { |
|
48 | + ->willReturnCallback(function($app, $key, $default) use (&$appConfig) { |
|
49 | 49 | return (isset($appConfig[$app]) and isset($appConfig[$app][$key])) ? $appConfig[$app][$key] : $default; |
50 | 50 | }); |
51 | 51 | $config->expects($this->any()) |
52 | 52 | ->method('setValue') |
53 | - ->willReturnCallback(function ($app, $key, $value) use (&$appConfig) { |
|
53 | + ->willReturnCallback(function($app, $key, $value) use (&$appConfig) { |
|
54 | 54 | if (!isset($appConfig[$app])) { |
55 | 55 | $appConfig[$app] = []; |
56 | 56 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | }); |
59 | 59 | $config->expects($this->any()) |
60 | 60 | ->method('getValues') |
61 | - ->willReturnCallback(function ($app, $key) use (&$appConfig) { |
|
61 | + ->willReturnCallback(function($app, $key) use (&$appConfig) { |
|
62 | 62 | if ($app) { |
63 | 63 | return $appConfig[$app]; |
64 | 64 | } else { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | }); |
74 | 74 | $config->expects($this->any()) |
75 | 75 | ->method('searchValues') |
76 | - ->willReturnCallback(function ($key, $lazy, $type) use (&$appConfig) { |
|
76 | + ->willReturnCallback(function($key, $lazy, $type) use (&$appConfig) { |
|
77 | 77 | $values = []; |
78 | 78 | foreach ($appConfig as $appid => $appData) { |
79 | 79 | if (isset($appData[$key])) { |
@@ -171,16 +171,16 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | public static function dataGetAppIcon(): array { |
174 | - $nothing = function ($appId) { |
|
174 | + $nothing = function($appId) { |
|
175 | 175 | self::assertEquals('test', $appId); |
176 | 176 | throw new \RuntimeException(); |
177 | 177 | }; |
178 | 178 | |
179 | - $createCallback = function ($workingIcons) { |
|
180 | - return function ($appId, $icon) use ($workingIcons) { |
|
179 | + $createCallback = function($workingIcons) { |
|
180 | + return function($appId, $icon) use ($workingIcons) { |
|
181 | 181 | self::assertEquals('test', $appId); |
182 | 182 | if (in_array($icon, $workingIcons)) { |
183 | - return '/path/' . $icon; |
|
183 | + return '/path/'.$icon; |
|
184 | 184 | } |
185 | 185 | throw new \RuntimeException(); |
186 | 186 | }; |
@@ -471,13 +471,13 @@ discard block |
||
471 | 471 | } |
472 | 472 | |
473 | 473 | public function testGetAppPath(): void { |
474 | - $this->assertEquals(\OC::$SERVERROOT . '/apps/files', $this->manager->getAppPath('files')); |
|
474 | + $this->assertEquals(\OC::$SERVERROOT.'/apps/files', $this->manager->getAppPath('files')); |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | public function testGetAppPathSymlink(): void { |
478 | 478 | $fakeAppDirname = sha1(uniqid('test', true)); |
479 | - $fakeAppPath = sys_get_temp_dir() . '/' . $fakeAppDirname; |
|
480 | - $fakeAppLink = \OC::$SERVERROOT . '/' . $fakeAppDirname; |
|
479 | + $fakeAppPath = sys_get_temp_dir().'/'.$fakeAppDirname; |
|
480 | + $fakeAppLink = \OC::$SERVERROOT.'/'.$fakeAppDirname; |
|
481 | 481 | |
482 | 482 | mkdir($fakeAppPath); |
483 | 483 | if (symlink($fakeAppPath, $fakeAppLink) === false) { |
@@ -487,11 +487,11 @@ discard block |
||
487 | 487 | // Use the symlink as the app path |
488 | 488 | \OC::$APPSROOTS[] = [ |
489 | 489 | 'path' => $fakeAppLink, |
490 | - 'url' => \OC::$WEBROOT . '/' . $fakeAppDirname, |
|
490 | + 'url' => \OC::$WEBROOT.'/'.$fakeAppDirname, |
|
491 | 491 | 'writable' => false, |
492 | 492 | ]; |
493 | 493 | |
494 | - $fakeTestAppPath = $fakeAppPath . '/' . 'test-test-app'; |
|
494 | + $fakeTestAppPath = $fakeAppPath.'/'.'test-test-app'; |
|
495 | 495 | mkdir($fakeTestAppPath); |
496 | 496 | |
497 | 497 | $generatedAppPath = $this->manager->getAppPath('test-test-app'); |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | unlink($fakeAppLink); |
501 | 501 | rmdir($fakeAppPath); |
502 | 502 | |
503 | - $this->assertEquals($fakeAppLink . '/test-test-app', $generatedAppPath); |
|
503 | + $this->assertEquals($fakeAppLink.'/test-test-app', $generatedAppPath); |
|
504 | 504 | } |
505 | 505 | |
506 | 506 | public function testGetAppPathFail(): void { |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | $manager->expects($this->any()) |
645 | 645 | ->method('getAppInfo') |
646 | 646 | ->willReturnCallback( |
647 | - function ($appId) use ($appInfos) { |
|
647 | + function($appId) use ($appInfos) { |
|
648 | 648 | return $appInfos[$appId]; |
649 | 649 | } |
650 | 650 | ); |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | $manager->expects($this->any()) |
704 | 704 | ->method('getAppInfo') |
705 | 705 | ->willReturnCallback( |
706 | - function ($appId) use ($appInfos) { |
|
706 | + function($appId) use ($appInfos) { |
|
707 | 707 | return $appInfos[$appId]; |
708 | 708 | } |
709 | 709 | ); |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | $this->registerParameter('isCLI', \OC::$CLI); |
264 | 264 | $this->registerParameter('serverRoot', \OC::$SERVERROOT); |
265 | 265 | |
266 | - $this->registerService(ContainerInterface::class, function (ContainerInterface $c) { |
|
266 | + $this->registerService(ContainerInterface::class, function(ContainerInterface $c) { |
|
267 | 267 | return $c; |
268 | 268 | }); |
269 | - $this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) { |
|
269 | + $this->registerService(\OCP\IServerContainer::class, function(ContainerInterface $c) { |
|
270 | 270 | return $c; |
271 | 271 | }); |
272 | 272 | |
@@ -284,11 +284,11 @@ discard block |
||
284 | 284 | |
285 | 285 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
286 | 286 | |
287 | - $this->registerService(View::class, function (Server $c) { |
|
287 | + $this->registerService(View::class, function(Server $c) { |
|
288 | 288 | return new View(); |
289 | 289 | }, false); |
290 | 290 | |
291 | - $this->registerService(IPreview::class, function (ContainerInterface $c) { |
|
291 | + $this->registerService(IPreview::class, function(ContainerInterface $c) { |
|
292 | 292 | return new PreviewManager( |
293 | 293 | $c->get(\OCP\IConfig::class), |
294 | 294 | $c->get(IRootFolder::class), |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | }); |
308 | 308 | $this->registerAlias(IMimeIconProvider::class, MimeIconProvider::class); |
309 | 309 | |
310 | - $this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) { |
|
310 | + $this->registerService(\OC\Preview\Watcher::class, function(ContainerInterface $c) { |
|
311 | 311 | return new \OC\Preview\Watcher( |
312 | 312 | new \OC\Preview\Storage\Root( |
313 | 313 | $c->get(IRootFolder::class), |
@@ -316,11 +316,11 @@ discard block |
||
316 | 316 | ); |
317 | 317 | }); |
318 | 318 | |
319 | - $this->registerService(IProfiler::class, function (Server $c) { |
|
319 | + $this->registerService(IProfiler::class, function(Server $c) { |
|
320 | 320 | return new Profiler($c->get(SystemConfig::class)); |
321 | 321 | }); |
322 | 322 | |
323 | - $this->registerService(\OCP\Encryption\IManager::class, function (Server $c): Encryption\Manager { |
|
323 | + $this->registerService(\OCP\Encryption\IManager::class, function(Server $c): Encryption\Manager { |
|
324 | 324 | $view = new View(); |
325 | 325 | $util = new Encryption\Util( |
326 | 326 | $view, |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | ); |
339 | 339 | }); |
340 | 340 | |
341 | - $this->registerService(IFile::class, function (ContainerInterface $c) { |
|
341 | + $this->registerService(IFile::class, function(ContainerInterface $c) { |
|
342 | 342 | $util = new Encryption\Util( |
343 | 343 | new View(), |
344 | 344 | $c->get(IUserManager::class), |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | ); |
353 | 353 | }); |
354 | 354 | |
355 | - $this->registerService(IStorage::class, function (ContainerInterface $c) { |
|
355 | + $this->registerService(IStorage::class, function(ContainerInterface $c) { |
|
356 | 356 | $view = new View(); |
357 | 357 | $util = new Encryption\Util( |
358 | 358 | $view, |
@@ -371,23 +371,23 @@ discard block |
||
371 | 371 | |
372 | 372 | $this->registerAlias(\OCP\ITagManager::class, TagManager::class); |
373 | 373 | |
374 | - $this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) { |
|
374 | + $this->registerService('SystemTagManagerFactory', function(ContainerInterface $c) { |
|
375 | 375 | /** @var \OCP\IConfig $config */ |
376 | 376 | $config = $c->get(\OCP\IConfig::class); |
377 | 377 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
378 | 378 | return new $factoryClass($this); |
379 | 379 | }); |
380 | - $this->registerService(ISystemTagManager::class, function (ContainerInterface $c) { |
|
380 | + $this->registerService(ISystemTagManager::class, function(ContainerInterface $c) { |
|
381 | 381 | return $c->get('SystemTagManagerFactory')->getManager(); |
382 | 382 | }); |
383 | 383 | /** @deprecated 19.0.0 */ |
384 | 384 | $this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class); |
385 | 385 | |
386 | - $this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) { |
|
386 | + $this->registerService(ISystemTagObjectMapper::class, function(ContainerInterface $c) { |
|
387 | 387 | return $c->get('SystemTagManagerFactory')->getObjectMapper(); |
388 | 388 | }); |
389 | 389 | $this->registerAlias(IFileAccess::class, FileAccess::class); |
390 | - $this->registerService('RootFolder', function (ContainerInterface $c) { |
|
390 | + $this->registerService('RootFolder', function(ContainerInterface $c) { |
|
391 | 391 | $manager = \OC\Files\Filesystem::getMountManager(); |
392 | 392 | $view = new View(); |
393 | 393 | /** @var IUserSession $userSession */ |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | |
413 | 413 | return $root; |
414 | 414 | }); |
415 | - $this->registerService(HookConnector::class, function (ContainerInterface $c) { |
|
415 | + $this->registerService(HookConnector::class, function(ContainerInterface $c) { |
|
416 | 416 | return new HookConnector( |
417 | 417 | $c->get(IRootFolder::class), |
418 | 418 | new View(), |
@@ -421,19 +421,19 @@ discard block |
||
421 | 421 | ); |
422 | 422 | }); |
423 | 423 | |
424 | - $this->registerService(IRootFolder::class, function (ContainerInterface $c) { |
|
425 | - return new LazyRoot(function () use ($c) { |
|
424 | + $this->registerService(IRootFolder::class, function(ContainerInterface $c) { |
|
425 | + return new LazyRoot(function() use ($c) { |
|
426 | 426 | return $c->get('RootFolder'); |
427 | 427 | }); |
428 | 428 | }); |
429 | 429 | |
430 | 430 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
431 | 431 | |
432 | - $this->registerService(DisplayNameCache::class, function (ContainerInterface $c) { |
|
432 | + $this->registerService(DisplayNameCache::class, function(ContainerInterface $c) { |
|
433 | 433 | return $c->get(\OC\User\Manager::class)->getDisplayNameCache(); |
434 | 434 | }); |
435 | 435 | |
436 | - $this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) { |
|
436 | + $this->registerService(\OCP\IGroupManager::class, function(ContainerInterface $c) { |
|
437 | 437 | $groupManager = new \OC\Group\Manager( |
438 | 438 | $this->get(IUserManager::class), |
439 | 439 | $this->get(IEventDispatcher::class), |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | return $groupManager; |
445 | 445 | }); |
446 | 446 | |
447 | - $this->registerService(Store::class, function (ContainerInterface $c) { |
|
447 | + $this->registerService(Store::class, function(ContainerInterface $c) { |
|
448 | 448 | $session = $c->get(ISession::class); |
449 | 449 | if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { |
450 | 450 | $tokenProvider = $c->get(IProvider::class); |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
460 | 460 | $this->registerAlias(OCPIProvider::class, Authentication\Token\Manager::class); |
461 | 461 | |
462 | - $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
462 | + $this->registerService(\OC\User\Session::class, function(Server $c) { |
|
463 | 463 | $manager = $c->get(IUserManager::class); |
464 | 464 | $session = new \OC\Session\Memory(); |
465 | 465 | $timeFactory = new TimeFactory(); |
@@ -483,40 +483,40 @@ discard block |
||
483 | 483 | $c->get(IEventDispatcher::class), |
484 | 484 | ); |
485 | 485 | /** @deprecated 21.0.0 use BeforeUserCreatedEvent event with the IEventDispatcher instead */ |
486 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
486 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
487 | 487 | \OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]); |
488 | 488 | }); |
489 | 489 | /** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */ |
490 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
490 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
491 | 491 | /** @var \OC\User\User $user */ |
492 | 492 | \OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]); |
493 | 493 | }); |
494 | 494 | /** @deprecated 21.0.0 use BeforeUserDeletedEvent event with the IEventDispatcher instead */ |
495 | - $userSession->listen('\OC\User', 'preDelete', function ($user) { |
|
495 | + $userSession->listen('\OC\User', 'preDelete', function($user) { |
|
496 | 496 | /** @var \OC\User\User $user */ |
497 | 497 | \OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]); |
498 | 498 | }); |
499 | 499 | /** @deprecated 21.0.0 use UserDeletedEvent event with the IEventDispatcher instead */ |
500 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
500 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
501 | 501 | /** @var \OC\User\User $user */ |
502 | 502 | \OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]); |
503 | 503 | }); |
504 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
504 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
505 | 505 | /** @var \OC\User\User $user */ |
506 | 506 | \OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
507 | 507 | }); |
508 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
508 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
509 | 509 | /** @var \OC\User\User $user */ |
510 | 510 | \OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
511 | 511 | }); |
512 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
512 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
513 | 513 | \OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]); |
514 | 514 | |
515 | 515 | /** @var IEventDispatcher $dispatcher */ |
516 | 516 | $dispatcher = $this->get(IEventDispatcher::class); |
517 | 517 | $dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password)); |
518 | 518 | }); |
519 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) { |
|
519 | + $userSession->listen('\OC\User', 'postLogin', function($user, $loginName, $password, $isTokenLogin) { |
|
520 | 520 | /** @var \OC\User\User $user */ |
521 | 521 | \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]); |
522 | 522 | |
@@ -524,12 +524,12 @@ discard block |
||
524 | 524 | $dispatcher = $this->get(IEventDispatcher::class); |
525 | 525 | $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin)); |
526 | 526 | }); |
527 | - $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { |
|
527 | + $userSession->listen('\OC\User', 'preRememberedLogin', function($uid) { |
|
528 | 528 | /** @var IEventDispatcher $dispatcher */ |
529 | 529 | $dispatcher = $this->get(IEventDispatcher::class); |
530 | 530 | $dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); |
531 | 531 | }); |
532 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
532 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
533 | 533 | /** @var \OC\User\User $user */ |
534 | 534 | \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]); |
535 | 535 | |
@@ -537,19 +537,19 @@ discard block |
||
537 | 537 | $dispatcher = $this->get(IEventDispatcher::class); |
538 | 538 | $dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password)); |
539 | 539 | }); |
540 | - $userSession->listen('\OC\User', 'logout', function ($user) { |
|
540 | + $userSession->listen('\OC\User', 'logout', function($user) { |
|
541 | 541 | \OC_Hook::emit('OC_User', 'logout', []); |
542 | 542 | |
543 | 543 | /** @var IEventDispatcher $dispatcher */ |
544 | 544 | $dispatcher = $this->get(IEventDispatcher::class); |
545 | 545 | $dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user)); |
546 | 546 | }); |
547 | - $userSession->listen('\OC\User', 'postLogout', function ($user) { |
|
547 | + $userSession->listen('\OC\User', 'postLogout', function($user) { |
|
548 | 548 | /** @var IEventDispatcher $dispatcher */ |
549 | 549 | $dispatcher = $this->get(IEventDispatcher::class); |
550 | 550 | $dispatcher->dispatchTyped(new UserLoggedOutEvent($user)); |
551 | 551 | }); |
552 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
552 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
553 | 553 | /** @var \OC\User\User $user */ |
554 | 554 | \OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]); |
555 | 555 | }); |
@@ -563,14 +563,14 @@ discard block |
||
563 | 563 | |
564 | 564 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
565 | 565 | |
566 | - $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
|
566 | + $this->registerService(\OC\SystemConfig::class, function($c) use ($config) { |
|
567 | 567 | return new \OC\SystemConfig($config); |
568 | 568 | }); |
569 | 569 | |
570 | 570 | $this->registerAlias(IAppConfig::class, \OC\AppConfig::class); |
571 | 571 | $this->registerAlias(IUserConfig::class, \OC\Config\UserConfig::class); |
572 | 572 | |
573 | - $this->registerService(IFactory::class, function (Server $c) { |
|
573 | + $this->registerService(IFactory::class, function(Server $c) { |
|
574 | 574 | return new \OC\L10N\Factory( |
575 | 575 | $c->get(\OCP\IConfig::class), |
576 | 576 | $c->getRequest(), |
@@ -583,11 +583,11 @@ discard block |
||
583 | 583 | |
584 | 584 | $this->registerAlias(IURLGenerator::class, URLGenerator::class); |
585 | 585 | |
586 | - $this->registerService(ICache::class, function ($c) { |
|
586 | + $this->registerService(ICache::class, function($c) { |
|
587 | 587 | return new Cache\File(); |
588 | 588 | }); |
589 | 589 | |
590 | - $this->registerService(Factory::class, function (Server $c) { |
|
590 | + $this->registerService(Factory::class, function(Server $c) { |
|
591 | 591 | $profiler = $c->get(IProfiler::class); |
592 | 592 | $arrayCacheFactory = new \OC\Memcache\Factory(fn () => '', $c->get(LoggerInterface::class), |
593 | 593 | $profiler, |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | |
603 | 603 | if ($config->getValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { |
604 | 604 | $logQuery = $config->getValue('log_query'); |
605 | - $prefixClosure = function () use ($logQuery, $serverVersion): ?string { |
|
605 | + $prefixClosure = function() use ($logQuery, $serverVersion): ?string { |
|
606 | 606 | if (!$logQuery) { |
607 | 607 | try { |
608 | 608 | $v = \OCP\Server::get(IAppConfig::class)->getAppInstalledVersions(true); |
@@ -620,10 +620,10 @@ discard block |
||
620 | 620 | ]; |
621 | 621 | } |
622 | 622 | $v['core'] = implode(',', $serverVersion->getVersion()); |
623 | - $version = implode(',', array_keys($v)) . implode(',', $v); |
|
623 | + $version = implode(',', array_keys($v)).implode(',', $v); |
|
624 | 624 | $instanceId = \OC_Util::getInstanceId(); |
625 | 625 | $path = \OC::$SERVERROOT; |
626 | - return md5($instanceId . '-' . $version . '-' . $path); |
|
626 | + return md5($instanceId.'-'.$version.'-'.$path); |
|
627 | 627 | }; |
628 | 628 | return new \OC\Memcache\Factory($prefixClosure, |
629 | 629 | $c->get(LoggerInterface::class), |
@@ -642,12 +642,12 @@ discard block |
||
642 | 642 | }); |
643 | 643 | $this->registerAlias(ICacheFactory::class, Factory::class); |
644 | 644 | |
645 | - $this->registerService('RedisFactory', function (Server $c) { |
|
645 | + $this->registerService('RedisFactory', function(Server $c) { |
|
646 | 646 | $systemConfig = $c->get(SystemConfig::class); |
647 | 647 | return new RedisFactory($systemConfig, $c->get(IEventLogger::class)); |
648 | 648 | }); |
649 | 649 | |
650 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
650 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
651 | 651 | $l10n = $this->get(IFactory::class)->get('lib'); |
652 | 652 | return new \OC\Activity\Manager( |
653 | 653 | $c->getRequest(), |
@@ -659,14 +659,14 @@ discard block |
||
659 | 659 | ); |
660 | 660 | }); |
661 | 661 | |
662 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
662 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
663 | 663 | return new \OC\Activity\EventMerger( |
664 | 664 | $c->getL10N('lib') |
665 | 665 | ); |
666 | 666 | }); |
667 | 667 | $this->registerAlias(IValidator::class, Validator::class); |
668 | 668 | |
669 | - $this->registerService(AvatarManager::class, function (Server $c) { |
|
669 | + $this->registerService(AvatarManager::class, function(Server $c) { |
|
670 | 670 | return new AvatarManager( |
671 | 671 | $c->get(IUserSession::class), |
672 | 672 | $c->get(\OC\User\Manager::class), |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | $this->registerAlias(\OCP\Support\Subscription\IAssertion::class, \OC\Support\Subscription\Assertion::class); |
687 | 687 | |
688 | 688 | /** Only used by the PsrLoggerAdapter should not be used by apps */ |
689 | - $this->registerService(\OC\Log::class, function (Server $c) { |
|
689 | + $this->registerService(\OC\Log::class, function(Server $c) { |
|
690 | 690 | $logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file'); |
691 | 691 | $factory = new LogFactory($c, $this->get(SystemConfig::class)); |
692 | 692 | $logger = $factory->get($logType); |
@@ -697,13 +697,13 @@ discard block |
||
697 | 697 | // PSR-3 logger |
698 | 698 | $this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class); |
699 | 699 | |
700 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
700 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
701 | 701 | return new LogFactory($c, $this->get(SystemConfig::class)); |
702 | 702 | }); |
703 | 703 | |
704 | 704 | $this->registerAlias(IJobList::class, \OC\BackgroundJob\JobList::class); |
705 | 705 | |
706 | - $this->registerService(Router::class, function (Server $c) { |
|
706 | + $this->registerService(Router::class, function(Server $c) { |
|
707 | 707 | $cacheFactory = $c->get(ICacheFactory::class); |
708 | 708 | if ($cacheFactory->isLocalCacheAvailable()) { |
709 | 709 | $router = $c->resolve(CachingRouter::class); |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | }); |
715 | 715 | $this->registerAlias(IRouter::class, Router::class); |
716 | 716 | |
717 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
717 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
718 | 718 | $config = $c->get(\OCP\IConfig::class); |
719 | 719 | if (ltrim($config->getSystemValueString('memcache.distributed', ''), '\\') === \OC\Memcache\Redis::class) { |
720 | 720 | $backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend( |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | $this->registerAlias(ICredentialsManager::class, CredentialsManager::class); |
745 | 745 | |
746 | 746 | $this->registerAlias(IDBConnection::class, ConnectionAdapter::class); |
747 | - $this->registerService(Connection::class, function (Server $c) { |
|
747 | + $this->registerService(Connection::class, function(Server $c) { |
|
748 | 748 | $systemConfig = $c->get(SystemConfig::class); |
749 | 749 | $factory = new \OC\DB\ConnectionFactory($systemConfig, $c->get(ICacheFactory::class)); |
750 | 750 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -757,17 +757,17 @@ discard block |
||
757 | 757 | |
758 | 758 | $this->registerAlias(ICertificateManager::class, CertificateManager::class); |
759 | 759 | $this->registerAlias(IClientService::class, ClientService::class); |
760 | - $this->registerService(NegativeDnsCache::class, function (ContainerInterface $c) { |
|
760 | + $this->registerService(NegativeDnsCache::class, function(ContainerInterface $c) { |
|
761 | 761 | return new NegativeDnsCache( |
762 | 762 | $c->get(ICacheFactory::class), |
763 | 763 | ); |
764 | 764 | }); |
765 | 765 | $this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
766 | - $this->registerService(IEventLogger::class, function (ContainerInterface $c) { |
|
766 | + $this->registerService(IEventLogger::class, function(ContainerInterface $c) { |
|
767 | 767 | return new EventLogger($c->get(SystemConfig::class), $c->get(LoggerInterface::class), $c->get(Log::class)); |
768 | 768 | }); |
769 | 769 | |
770 | - $this->registerService(IQueryLogger::class, function (ContainerInterface $c) { |
|
770 | + $this->registerService(IQueryLogger::class, function(ContainerInterface $c) { |
|
771 | 771 | $queryLogger = new QueryLogger(); |
772 | 772 | if ($c->get(SystemConfig::class)->getValue('debug', false)) { |
773 | 773 | // In debug mode, module is being activated by default |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | |
779 | 779 | $this->registerAlias(ITempManager::class, TempManager::class); |
780 | 780 | |
781 | - $this->registerService(AppManager::class, function (ContainerInterface $c) { |
|
781 | + $this->registerService(AppManager::class, function(ContainerInterface $c) { |
|
782 | 782 | // TODO: use auto-wiring |
783 | 783 | return new \OC\App\AppManager( |
784 | 784 | $c->get(IUserSession::class), |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | |
795 | 795 | $this->registerAlias(IDateTimeZone::class, DateTimeZone::class); |
796 | 796 | |
797 | - $this->registerService(IDateTimeFormatter::class, function (Server $c) { |
|
797 | + $this->registerService(IDateTimeFormatter::class, function(Server $c) { |
|
798 | 798 | $language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null); |
799 | 799 | |
800 | 800 | return new DateTimeFormatter( |
@@ -803,14 +803,14 @@ discard block |
||
803 | 803 | ); |
804 | 804 | }); |
805 | 805 | |
806 | - $this->registerService(IUserMountCache::class, function (ContainerInterface $c) { |
|
806 | + $this->registerService(IUserMountCache::class, function(ContainerInterface $c) { |
|
807 | 807 | $mountCache = $c->get(UserMountCache::class); |
808 | 808 | $listener = new UserMountCacheListener($mountCache); |
809 | 809 | $listener->listen($c->get(IUserManager::class)); |
810 | 810 | return $mountCache; |
811 | 811 | }); |
812 | 812 | |
813 | - $this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) { |
|
813 | + $this->registerService(IMountProviderCollection::class, function(ContainerInterface $c) { |
|
814 | 814 | $loader = $c->get(IStorageFactory::class); |
815 | 815 | $mountCache = $c->get(IUserMountCache::class); |
816 | 816 | $eventLogger = $c->get(IEventLogger::class); |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | return $manager; |
831 | 831 | }); |
832 | 832 | |
833 | - $this->registerService(IBus::class, function (ContainerInterface $c) { |
|
833 | + $this->registerService(IBus::class, function(ContainerInterface $c) { |
|
834 | 834 | $busClass = $c->get(\OCP\IConfig::class)->getSystemValueString('commandbus'); |
835 | 835 | if ($busClass) { |
836 | 836 | [$app, $class] = explode('::', $busClass, 2); |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | $this->registerAlias(ITrustedDomainHelper::class, TrustedDomainHelper::class); |
850 | 850 | $this->registerAlias(IThrottler::class, Throttler::class); |
851 | 851 | |
852 | - $this->registerService(\OC\Security\Bruteforce\Backend\IBackend::class, function ($c) { |
|
852 | + $this->registerService(\OC\Security\Bruteforce\Backend\IBackend::class, function($c) { |
|
853 | 853 | $config = $c->get(\OCP\IConfig::class); |
854 | 854 | if (!$config->getSystemValueBool('auth.bruteforce.protection.force.database', false) |
855 | 855 | && ltrim($config->getSystemValueString('memcache.distributed', ''), '\\') === \OC\Memcache\Redis::class) { |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | }); |
863 | 863 | |
864 | 864 | $this->registerDeprecatedAlias('IntegrityCodeChecker', Checker::class); |
865 | - $this->registerService(Checker::class, function (ContainerInterface $c) { |
|
865 | + $this->registerService(Checker::class, function(ContainerInterface $c) { |
|
866 | 866 | // IConfig requires a working database. This code |
867 | 867 | // might however be called when Nextcloud is not yet setup. |
868 | 868 | if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | $c->get(IMimeTypeDetector::class) |
886 | 886 | ); |
887 | 887 | }); |
888 | - $this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) { |
|
888 | + $this->registerService(\OCP\IRequest::class, function(ContainerInterface $c) { |
|
889 | 889 | if (isset($this['urlParams'])) { |
890 | 890 | $urlParams = $this['urlParams']; |
891 | 891 | } else { |
@@ -920,14 +920,14 @@ discard block |
||
920 | 920 | ); |
921 | 921 | }); |
922 | 922 | |
923 | - $this->registerService(IRequestId::class, function (ContainerInterface $c): IRequestId { |
|
923 | + $this->registerService(IRequestId::class, function(ContainerInterface $c): IRequestId { |
|
924 | 924 | return new RequestId( |
925 | 925 | $_SERVER['UNIQUE_ID'] ?? '', |
926 | 926 | $this->get(ISecureRandom::class) |
927 | 927 | ); |
928 | 928 | }); |
929 | 929 | |
930 | - $this->registerService(IMailer::class, function (Server $c) { |
|
930 | + $this->registerService(IMailer::class, function(Server $c) { |
|
931 | 931 | return new Mailer( |
932 | 932 | $c->get(\OCP\IConfig::class), |
933 | 933 | $c->get(LoggerInterface::class), |
@@ -942,7 +942,7 @@ discard block |
||
942 | 942 | /** @since 30.0.0 */ |
943 | 943 | $this->registerAlias(\OCP\Mail\Provider\IManager::class, \OC\Mail\Provider\Manager::class); |
944 | 944 | |
945 | - $this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) { |
|
945 | + $this->registerService(ILDAPProviderFactory::class, function(ContainerInterface $c) { |
|
946 | 946 | $config = $c->get(\OCP\IConfig::class); |
947 | 947 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
948 | 948 | if (is_null($factoryClass) || !class_exists($factoryClass)) { |
@@ -951,11 +951,11 @@ discard block |
||
951 | 951 | /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ |
952 | 952 | return new $factoryClass($this); |
953 | 953 | }); |
954 | - $this->registerService(ILDAPProvider::class, function (ContainerInterface $c) { |
|
954 | + $this->registerService(ILDAPProvider::class, function(ContainerInterface $c) { |
|
955 | 955 | $factory = $c->get(ILDAPProviderFactory::class); |
956 | 956 | return $factory->getLDAPProvider(); |
957 | 957 | }); |
958 | - $this->registerService(ILockingProvider::class, function (ContainerInterface $c) { |
|
958 | + $this->registerService(ILockingProvider::class, function(ContainerInterface $c) { |
|
959 | 959 | $ini = $c->get(IniGetWrapper::class); |
960 | 960 | $config = $c->get(\OCP\IConfig::class); |
961 | 961 | $ttl = $config->getSystemValueInt('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -977,51 +977,51 @@ discard block |
||
977 | 977 | return new NoopLockingProvider(); |
978 | 978 | }); |
979 | 979 | |
980 | - $this->registerService(ILockManager::class, function (Server $c): LockManager { |
|
980 | + $this->registerService(ILockManager::class, function(Server $c): LockManager { |
|
981 | 981 | return new LockManager(); |
982 | 982 | }); |
983 | 983 | |
984 | 984 | $this->registerAlias(ILockdownManager::class, 'LockdownManager'); |
985 | - $this->registerService(SetupManager::class, function ($c) { |
|
985 | + $this->registerService(SetupManager::class, function($c) { |
|
986 | 986 | // create the setupmanager through the mount manager to resolve the cyclic dependency |
987 | 987 | return $c->get(\OC\Files\Mount\Manager::class)->getSetupManager(); |
988 | 988 | }); |
989 | 989 | $this->registerAlias(IMountManager::class, \OC\Files\Mount\Manager::class); |
990 | 990 | |
991 | - $this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) { |
|
991 | + $this->registerService(IMimeTypeDetector::class, function(ContainerInterface $c) { |
|
992 | 992 | return new \OC\Files\Type\Detection( |
993 | 993 | $c->get(IURLGenerator::class), |
994 | 994 | $c->get(LoggerInterface::class), |
995 | 995 | \OC::$configDir, |
996 | - \OC::$SERVERROOT . '/resources/config/' |
|
996 | + \OC::$SERVERROOT.'/resources/config/' |
|
997 | 997 | ); |
998 | 998 | }); |
999 | 999 | |
1000 | 1000 | $this->registerAlias(IMimeTypeLoader::class, Loader::class); |
1001 | - $this->registerService(BundleFetcher::class, function () { |
|
1001 | + $this->registerService(BundleFetcher::class, function() { |
|
1002 | 1002 | return new BundleFetcher($this->getL10N('lib')); |
1003 | 1003 | }); |
1004 | 1004 | $this->registerAlias(\OCP\Notification\IManager::class, Manager::class); |
1005 | 1005 | |
1006 | - $this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) { |
|
1006 | + $this->registerService(CapabilitiesManager::class, function(ContainerInterface $c) { |
|
1007 | 1007 | $manager = new CapabilitiesManager($c->get(LoggerInterface::class)); |
1008 | - $manager->registerCapability(function () use ($c) { |
|
1008 | + $manager->registerCapability(function() use ($c) { |
|
1009 | 1009 | return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class)); |
1010 | 1010 | }); |
1011 | - $manager->registerCapability(function () use ($c) { |
|
1011 | + $manager->registerCapability(function() use ($c) { |
|
1012 | 1012 | return $c->get(\OC\Security\Bruteforce\Capabilities::class); |
1013 | 1013 | }); |
1014 | 1014 | return $manager; |
1015 | 1015 | }); |
1016 | 1016 | |
1017 | - $this->registerService(ICommentsManager::class, function (Server $c) { |
|
1017 | + $this->registerService(ICommentsManager::class, function(Server $c) { |
|
1018 | 1018 | $config = $c->get(\OCP\IConfig::class); |
1019 | 1019 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
1020 | 1020 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
1021 | 1021 | $factory = new $factoryClass($this); |
1022 | 1022 | $manager = $factory->getManager(); |
1023 | 1023 | |
1024 | - $manager->registerDisplayNameResolver('user', function ($id) use ($c) { |
|
1024 | + $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
|
1025 | 1025 | $manager = $c->get(IUserManager::class); |
1026 | 1026 | $userDisplayName = $manager->getDisplayName($id); |
1027 | 1027 | if ($userDisplayName === null) { |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | }); |
1036 | 1036 | |
1037 | 1037 | $this->registerAlias(\OC_Defaults::class, 'ThemingDefaults'); |
1038 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
1038 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
1039 | 1039 | try { |
1040 | 1040 | $classExists = class_exists('OCA\Theming\ThemingDefaults'); |
1041 | 1041 | } catch (\OCP\AutoloadNotAllowedException $e) { |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | } |
1077 | 1077 | return new \OC_Defaults(); |
1078 | 1078 | }); |
1079 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
1079 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
1080 | 1080 | return new JSCombiner( |
1081 | 1081 | $c->getAppDataDir('js'), |
1082 | 1082 | $c->get(IURLGenerator::class), |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | }); |
1088 | 1088 | $this->registerAlias(\OCP\EventDispatcher\IEventDispatcher::class, \OC\EventDispatcher\EventDispatcher::class); |
1089 | 1089 | |
1090 | - $this->registerService('CryptoWrapper', function (ContainerInterface $c) { |
|
1090 | + $this->registerService('CryptoWrapper', function(ContainerInterface $c) { |
|
1091 | 1091 | // FIXME: Instantiated here due to cyclic dependency |
1092 | 1092 | $request = new Request( |
1093 | 1093 | [ |
@@ -1111,12 +1111,12 @@ discard block |
||
1111 | 1111 | $request |
1112 | 1112 | ); |
1113 | 1113 | }); |
1114 | - $this->registerService(SessionStorage::class, function (ContainerInterface $c) { |
|
1114 | + $this->registerService(SessionStorage::class, function(ContainerInterface $c) { |
|
1115 | 1115 | return new SessionStorage($c->get(ISession::class)); |
1116 | 1116 | }); |
1117 | 1117 | $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class); |
1118 | 1118 | |
1119 | - $this->registerService(IProviderFactory::class, function (ContainerInterface $c) { |
|
1119 | + $this->registerService(IProviderFactory::class, function(ContainerInterface $c) { |
|
1120 | 1120 | $config = $c->get(\OCP\IConfig::class); |
1121 | 1121 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1122 | 1122 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1125,7 +1125,7 @@ discard block |
||
1125 | 1125 | |
1126 | 1126 | $this->registerAlias(\OCP\Share\IManager::class, \OC\Share20\Manager::class); |
1127 | 1127 | |
1128 | - $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) { |
|
1128 | + $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) { |
|
1129 | 1129 | $instance = new Collaboration\Collaborators\Search($c); |
1130 | 1130 | |
1131 | 1131 | // register default plugins |
@@ -1149,20 +1149,20 @@ discard block |
||
1149 | 1149 | |
1150 | 1150 | $this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class); |
1151 | 1151 | $this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class); |
1152 | - $this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) { |
|
1152 | + $this->registerService(\OC\Files\AppData\Factory::class, function(ContainerInterface $c) { |
|
1153 | 1153 | return new \OC\Files\AppData\Factory( |
1154 | 1154 | $c->get(IRootFolder::class), |
1155 | 1155 | $c->get(SystemConfig::class) |
1156 | 1156 | ); |
1157 | 1157 | }); |
1158 | 1158 | |
1159 | - $this->registerService('LockdownManager', function (ContainerInterface $c) { |
|
1160 | - return new LockdownManager(function () use ($c) { |
|
1159 | + $this->registerService('LockdownManager', function(ContainerInterface $c) { |
|
1160 | + return new LockdownManager(function() use ($c) { |
|
1161 | 1161 | return $c->get(ISession::class); |
1162 | 1162 | }); |
1163 | 1163 | }); |
1164 | 1164 | |
1165 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) { |
|
1165 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(ContainerInterface $c) { |
|
1166 | 1166 | return new DiscoveryService( |
1167 | 1167 | $c->get(ICacheFactory::class), |
1168 | 1168 | $c->get(IClientService::class) |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | }); |
1171 | 1171 | $this->registerAlias(IOCMDiscoveryService::class, OCMDiscoveryService::class); |
1172 | 1172 | |
1173 | - $this->registerService(ICloudIdManager::class, function (ContainerInterface $c) { |
|
1173 | + $this->registerService(ICloudIdManager::class, function(ContainerInterface $c) { |
|
1174 | 1174 | return new CloudIdManager( |
1175 | 1175 | $c->get(\OCP\Contacts\IManager::class), |
1176 | 1176 | $c->get(IURLGenerator::class), |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | |
1183 | 1183 | $this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class); |
1184 | 1184 | $this->registerAlias(ICloudFederationProviderManager::class, CloudFederationProviderManager::class); |
1185 | - $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1185 | + $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1186 | 1186 | return new CloudFederationFactory(); |
1187 | 1187 | }); |
1188 | 1188 | |
@@ -1191,23 +1191,23 @@ discard block |
||
1191 | 1191 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1192 | 1192 | $this->registerAlias(\Psr\Clock\ClockInterface::class, \OCP\AppFramework\Utility\ITimeFactory::class); |
1193 | 1193 | |
1194 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1194 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1195 | 1195 | return new Defaults( |
1196 | 1196 | $c->get('ThemingDefaults') |
1197 | 1197 | ); |
1198 | 1198 | }); |
1199 | 1199 | |
1200 | - $this->registerService(\OCP\ISession::class, function (ContainerInterface $c) { |
|
1200 | + $this->registerService(\OCP\ISession::class, function(ContainerInterface $c) { |
|
1201 | 1201 | return $c->get(\OCP\IUserSession::class)->getSession(); |
1202 | 1202 | }, false); |
1203 | 1203 | |
1204 | - $this->registerService(IShareHelper::class, function (ContainerInterface $c) { |
|
1204 | + $this->registerService(IShareHelper::class, function(ContainerInterface $c) { |
|
1205 | 1205 | return new ShareHelper( |
1206 | 1206 | $c->get(\OCP\Share\IManager::class) |
1207 | 1207 | ); |
1208 | 1208 | }); |
1209 | 1209 | |
1210 | - $this->registerService(Installer::class, function (ContainerInterface $c) { |
|
1210 | + $this->registerService(Installer::class, function(ContainerInterface $c) { |
|
1211 | 1211 | return new Installer( |
1212 | 1212 | $c->get(AppFetcher::class), |
1213 | 1213 | $c->get(IClientService::class), |
@@ -1218,11 +1218,11 @@ discard block |
||
1218 | 1218 | ); |
1219 | 1219 | }); |
1220 | 1220 | |
1221 | - $this->registerService(IApiFactory::class, function (ContainerInterface $c) { |
|
1221 | + $this->registerService(IApiFactory::class, function(ContainerInterface $c) { |
|
1222 | 1222 | return new ApiFactory($c->get(IClientService::class)); |
1223 | 1223 | }); |
1224 | 1224 | |
1225 | - $this->registerService(IInstanceFactory::class, function (ContainerInterface $c) { |
|
1225 | + $this->registerService(IInstanceFactory::class, function(ContainerInterface $c) { |
|
1226 | 1226 | $memcacheFactory = $c->get(ICacheFactory::class); |
1227 | 1227 | return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->get(IClientService::class)); |
1228 | 1228 | }); |
@@ -1706,11 +1706,11 @@ discard block |
||
1706 | 1706 | } |
1707 | 1707 | |
1708 | 1708 | private function registerDeprecatedAlias(string $alias, string $target) { |
1709 | - $this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) { |
|
1709 | + $this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) { |
|
1710 | 1710 | try { |
1711 | 1711 | /** @var LoggerInterface $logger */ |
1712 | 1712 | $logger = $container->get(LoggerInterface::class); |
1713 | - $logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
1713 | + $logger->debug('The requested alias "'.$alias.'" is deprecated. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
1714 | 1714 | } catch (ContainerExceptionInterface $e) { |
1715 | 1715 | // Could not get logger. Continue |
1716 | 1716 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | foreach ($this->appManager->getEnabledApps() as $app) { |
86 | 86 | try { |
87 | 87 | $appPath = $this->appManager->getAppPath($app); |
88 | - $file = $appPath . '/appinfo/routes.php'; |
|
88 | + $file = $appPath.'/appinfo/routes.php'; |
|
89 | 89 | if (file_exists($file)) { |
90 | 90 | $this->routingFiles[$app] = $file; |
91 | 91 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | if ($this->loaded) { |
112 | 112 | return; |
113 | 113 | } |
114 | - $this->eventLogger->start('route:load:' . $requestedApp, 'Loading Routes for ' . $requestedApp); |
|
114 | + $this->eventLogger->start('route:load:'.$requestedApp, 'Loading Routes for '.$requestedApp); |
|
115 | 115 | if (is_null($app)) { |
116 | 116 | $this->loaded = true; |
117 | 117 | $routingFiles = $this->getRoutingFiles(); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } |
128 | 128 | try { |
129 | 129 | $appPath = $this->appManager->getAppPath($app); |
130 | - $file = $appPath . '/appinfo/routes.php'; |
|
130 | + $file = $appPath.'/appinfo/routes.php'; |
|
131 | 131 | if (file_exists($file)) { |
132 | 132 | $routingFiles = [$app => $file]; |
133 | 133 | } else { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $this->root->addCollection($collection); |
159 | 159 | |
160 | 160 | // Also add the OCS collection |
161 | - $collection = $this->getCollection($app . '.ocs'); |
|
161 | + $collection = $this->getCollection($app.'.ocs'); |
|
162 | 162 | $collection->addPrefix('/ocsapp'); |
163 | 163 | $this->root->addCollection($collection); |
164 | 164 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $this->loadedApps['core'] = true; |
170 | 170 | $this->useCollection('root'); |
171 | 171 | $this->setupRoutes($this->getAttributeRoutes('core'), 'core'); |
172 | - $this->requireRouteFile(__DIR__ . '/../../../core/routes.php', 'core'); |
|
172 | + $this->requireRouteFile(__DIR__.'/../../../core/routes.php', 'core'); |
|
173 | 173 | |
174 | 174 | // Also add the OCS collection |
175 | 175 | $collection = $this->getCollection('root.ocs'); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $collection->addPrefix('/ocs'); |
182 | 182 | $this->root->addCollection($collection); |
183 | 183 | } |
184 | - $this->eventLogger->end('route:load:' . $requestedApp); |
|
184 | + $this->eventLogger->end('route:load:'.$requestedApp); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -245,14 +245,14 @@ discard block |
||
245 | 245 | $this->eventLogger->start('route:match', 'Match route'); |
246 | 246 | if (str_starts_with($url, '/apps/')) { |
247 | 247 | // empty string / 'apps' / $app / rest of the route |
248 | - [, , $app,] = explode('/', $url, 4); |
|
248 | + [,, $app, ] = explode('/', $url, 4); |
|
249 | 249 | |
250 | 250 | $app = $this->appManager->cleanAppId($app); |
251 | 251 | \OC::$REQUESTEDAPP = $app; |
252 | 252 | $this->loadRoutes($app); |
253 | 253 | } elseif (str_starts_with($url, '/ocsapp/apps/')) { |
254 | 254 | // empty string / 'ocsapp' / 'apps' / $app / rest of the route |
255 | - [, , , $app,] = explode('/', $url, 5); |
|
255 | + [,,, $app, ] = explode('/', $url, 5); |
|
256 | 256 | |
257 | 257 | $app = $this->appManager->cleanAppId($app); |
258 | 258 | \OC::$REQUESTEDAPP = $app; |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | // However, since Symfony does not allow empty route names, the route |
280 | 280 | // we need to match is '/', so we need to append the '/' here. |
281 | 281 | try { |
282 | - $parameters = $matcher->match($url . '/'); |
|
282 | + $parameters = $matcher->match($url.'/'); |
|
283 | 283 | } catch (ResourceNotFoundException $newException) { |
284 | 284 | // If we still didn't match a route, we throw the original exception |
285 | 285 | throw $e; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | $this->root->addCollection($collection); |
453 | 453 | |
454 | 454 | // Also add the OCS collection |
455 | - $collection = $this->getCollection($app . '.ocs'); |
|
455 | + $collection = $this->getCollection($app.'.ocs'); |
|
456 | 456 | $collection->addPrefix('/ocsapp'); |
457 | 457 | $this->root->addCollection($collection); |
458 | 458 | } |
@@ -464,11 +464,11 @@ discard block |
||
464 | 464 | $routes = []; |
465 | 465 | |
466 | 466 | if ($app === 'core') { |
467 | - $appControllerPath = __DIR__ . '/../../../core/Controller'; |
|
467 | + $appControllerPath = __DIR__.'/../../../core/Controller'; |
|
468 | 468 | $appNameSpace = 'OC\\Core'; |
469 | 469 | } else { |
470 | 470 | try { |
471 | - $appControllerPath = $this->appManager->getAppPath($app) . '/lib/Controller'; |
|
471 | + $appControllerPath = $this->appManager->getAppPath($app).'/lib/Controller'; |
|
472 | 472 | } catch (AppPathNotFoundException) { |
473 | 473 | return []; |
474 | 474 | } |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | continue; |
486 | 486 | } |
487 | 487 | |
488 | - $class = new ReflectionClass($appNameSpace . '\\Controller\\' . basename($file->getPathname(), '.php')); |
|
488 | + $class = new ReflectionClass($appNameSpace.'\\Controller\\'.basename($file->getPathname(), '.php')); |
|
489 | 489 | |
490 | 490 | foreach ($class->getMethods() as $method) { |
491 | 491 | foreach ($method->getAttributes(RouteAttribute::class, ReflectionAttribute::IS_INSTANCEOF) as $attribute) { |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | |
494 | 494 | $serializedRoute = $route->toArray(); |
495 | 495 | // Remove 'Controller' suffix |
496 | - $serializedRoute['name'] = substr($class->getShortName(), 0, -10) . '#' . $method->getName(); |
|
496 | + $serializedRoute['name'] = substr($class->getShortName(), 0, -10).'#'.$method->getName(); |
|
497 | 497 | |
498 | 498 | $key = $route->getType(); |
499 | 499 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | private function getApplicationClass(string $appName) { |
545 | 545 | $appNameSpace = App::buildAppNamespace($appName); |
546 | 546 | |
547 | - $applicationClassName = $appNameSpace . '\\AppInfo\\Application'; |
|
547 | + $applicationClassName = $appNameSpace.'\\AppInfo\\Application'; |
|
548 | 548 | |
549 | 549 | if (class_exists($applicationClassName)) { |
550 | 550 | $application = $this->container->get($applicationClassName); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function generate($name, $parameters = [], $absolute = false) { |
50 | 50 | asort($parameters); |
51 | - $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . (int)$absolute; |
|
51 | + $key = $this->context->getHost().'#'.$this->context->getBaseUrl().$name.sha1(json_encode($parameters)).(int) $absolute; |
|
52 | 52 | $cachedKey = $this->cache->get($key); |
53 | 53 | if ($cachedKey) { |
54 | 54 | return $cachedKey; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function findMatchingRoute(string $url): array { |
77 | 77 | $this->eventLogger->start('cacheroute:match', 'Match route'); |
78 | - $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . '#rootCollection'; |
|
78 | + $key = $this->context->getHost().'#'.$this->context->getBaseUrl().'#rootCollection'; |
|
79 | 79 | $cachedRoutes = $this->cache->get($key); |
80 | 80 | if (!$cachedRoutes) { |
81 | 81 | parent::loadRoutes(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // However, since Symfony does not allow empty route names, the route |
93 | 93 | // we need to match is '/', so we need to append the '/' here. |
94 | 94 | try { |
95 | - $parameters = $matcher->match($url . '/'); |
|
95 | + $parameters = $matcher->match($url.'/'); |
|
96 | 96 | } catch (ResourceNotFoundException $newException) { |
97 | 97 | // If we still didn't match a route, we throw the original exception |
98 | 98 | throw $e; |