@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $container = $this->getContainer(); |
| 58 | 58 | |
| 59 | - $container->registerService('defaultMailAddress', function () { |
|
| 59 | + $container->registerService('defaultMailAddress', function() { |
|
| 60 | 60 | return Util::getDefaultEmailAddress('lostpassword-noreply'); |
| 61 | 61 | }); |
| 62 | 62 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $notificationManager->registerNotifierService(AuthenticationNotifier::class); |
| 70 | 70 | |
| 71 | 71 | $eventDispatcher->addListener(IDBConnection::CHECK_MISSING_INDEXES_EVENT, |
| 72 | - function (GenericEvent $event) use ($container) { |
|
| 72 | + function(GenericEvent $event) use ($container) { |
|
| 73 | 73 | /** @var MissingIndexInformation $subject */ |
| 74 | 74 | $subject = $event->getSubject(); |
| 75 | 75 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public function prepare(INotification $notification, string $languageCode): INotification { |
| 60 | - if($notification->getApp() !== 'core') { |
|
| 60 | + if ($notification->getApp() !== 'core') { |
|
| 61 | 61 | throw new \InvalidArgumentException(); |
| 62 | 62 | } |
| 63 | 63 | $l = $this->l10nFactory->get('core', $languageCode); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | class Application extends App { |
| 37 | 37 | |
| 38 | - public function __construct (array $urlParams = array()) { |
|
| 38 | + public function __construct(array $urlParams = array()) { |
|
| 39 | 39 | parent::__construct('comments', $urlParams); |
| 40 | 40 | $container = $this->getContainer(); |
| 41 | 41 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | protected function registerDavEntity(EventDispatcherInterface $dispatcher) { |
| 70 | 70 | $dispatcher->addListener(CommentsEntityEvent::EVENT_ENTITY, function(CommentsEntityEvent $event) { |
| 71 | 71 | $event->addEntityCollection('files', function($name) { |
| 72 | - $nodes = \OC::$server->getUserFolder()->getById((int)$name); |
|
| 72 | + $nodes = \OC::$server->getUserFolder()->getById((int) $name); |
|
| 73 | 73 | return !empty($nodes); |
| 74 | 74 | }); |
| 75 | 75 | }); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | protected function registerCommentsEventHandler() { |
| 83 | - $this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function () { |
|
| 83 | + $this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function() { |
|
| 84 | 84 | return $this->getContainer()->query(EventHandler::class); |
| 85 | 85 | }); |
| 86 | 86 | } |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | * @since 9.0.0 |
| 97 | 97 | */ |
| 98 | 98 | public function prepare(INotification $notification, string $languageCode): INotification { |
| 99 | - if($notification->getApp() !== 'comments') { |
|
| 99 | + if ($notification->getApp() !== 'comments') { |
|
| 100 | 100 | throw new \InvalidArgumentException(); |
| 101 | 101 | } |
| 102 | 102 | try { |
| 103 | 103 | $comment = $this->commentsManager->get($notification->getObjectId()); |
| 104 | - } catch(NotFoundException $e) { |
|
| 104 | + } catch (NotFoundException $e) { |
|
| 105 | 105 | // needs to be converted to InvalidArgumentException, otherwise none Notifications will be shown at all |
| 106 | 106 | throw new \InvalidArgumentException('Comment not found', 0, $e); |
| 107 | 107 | } |
@@ -118,18 +118,18 @@ discard block |
||
| 118 | 118 | switch ($notification->getSubject()) { |
| 119 | 119 | case 'mention': |
| 120 | 120 | $parameters = $notification->getSubjectParameters(); |
| 121 | - if($parameters[0] !== 'files') { |
|
| 121 | + if ($parameters[0] !== 'files') { |
|
| 122 | 122 | throw new \InvalidArgumentException('Unsupported comment object'); |
| 123 | 123 | } |
| 124 | 124 | $userFolder = $this->rootFolder->getUserFolder($notification->getUser()); |
| 125 | - $nodes = $userFolder->getById((int)$parameters[1]); |
|
| 126 | - if(empty($nodes)) { |
|
| 125 | + $nodes = $userFolder->getById((int) $parameters[1]); |
|
| 126 | + if (empty($nodes)) { |
|
| 127 | 127 | throw new AlreadyProcessedException(); |
| 128 | 128 | } |
| 129 | 129 | $node = $nodes[0]; |
| 130 | 130 | |
| 131 | 131 | $path = rtrim($node->getPath(), '/'); |
| 132 | - if (strpos($path, '/' . $notification->getUser() . '/files/') === 0) { |
|
| 132 | + if (strpos($path, '/'.$notification->getUser().'/files/') === 0) { |
|
| 133 | 133 | // Remove /user/files/... |
| 134 | 134 | $fullPath = $path; |
| 135 | 135 | list(,,, $path) = explode('/', $fullPath, 4); |
@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | // the mention parameter ID does not include the mention ID (which |
| 194 | 194 | // could contain characters like '@' for user IDs) but a one-based |
| 195 | 195 | // index of the mentions of that type. |
| 196 | - $mentionParameterId = 'mention-' . $mention['type'] . $mentionTypeCount[$mention['type']]; |
|
| 197 | - $message = str_replace('@' . $mention['id'], '{' . $mentionParameterId . '}', $message); |
|
| 196 | + $mentionParameterId = 'mention-'.$mention['type'].$mentionTypeCount[$mention['type']]; |
|
| 197 | + $message = str_replace('@'.$mention['id'], '{'.$mentionParameterId.'}', $message); |
|
| 198 | 198 | try { |
| 199 | 199 | $displayName = $this->commentsManager->resolveDisplayName($mention['type'], $mention['id']); |
| 200 | 200 | } catch (\OutOfBoundsException $e) { |
@@ -214,9 +214,9 @@ discard block |
||
| 214 | 214 | public function richToParsed(string $message, array $parameters): string { |
| 215 | 215 | $placeholders = $replacements = []; |
| 216 | 216 | foreach ($parameters as $placeholder => $parameter) { |
| 217 | - $placeholders[] = '{' . $placeholder . '}'; |
|
| 217 | + $placeholders[] = '{'.$placeholder.'}'; |
|
| 218 | 218 | if ($parameter['type'] === 'user') { |
| 219 | - $replacements[] = '@' . $parameter['name']; |
|
| 219 | + $replacements[] = '@'.$parameter['name']; |
|
| 220 | 220 | } else if ($parameter['type'] === 'file') { |
| 221 | 221 | $replacements[] = $parameter['path']; |
| 222 | 222 | } else { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | // To find out if we are running from CLI or not |
| 183 | 183 | $this->registerParameter('isCLI', \OC::$CLI); |
| 184 | 184 | |
| 185 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
| 185 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
| 186 | 186 | return $c; |
| 187 | 187 | }); |
| 188 | 188 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
| 202 | 202 | |
| 203 | 203 | |
| 204 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
| 204 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
| 205 | 205 | return new PreviewManager( |
| 206 | 206 | $c->getConfig(), |
| 207 | 207 | $c->getRootFolder(), |
@@ -213,13 +213,13 @@ discard block |
||
| 213 | 213 | }); |
| 214 | 214 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
| 215 | 215 | |
| 216 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
| 216 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
| 217 | 217 | return new \OC\Preview\Watcher( |
| 218 | 218 | $c->getAppDataDir('preview') |
| 219 | 219 | ); |
| 220 | 220 | }); |
| 221 | 221 | |
| 222 | - $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
| 222 | + $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
|
| 223 | 223 | $view = new View(); |
| 224 | 224 | $util = new Encryption\Util( |
| 225 | 225 | $view, |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | }); |
| 239 | 239 | $this->registerAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
| 240 | 240 | |
| 241 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
| 241 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
| 242 | 242 | $util = new Encryption\Util( |
| 243 | 243 | new View(), |
| 244 | 244 | $c->getUserManager(), |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | ); |
| 253 | 253 | }); |
| 254 | 254 | |
| 255 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
| 255 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
| 256 | 256 | $view = new View(); |
| 257 | 257 | $util = new Encryption\Util( |
| 258 | 258 | $view, |
@@ -263,30 +263,30 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | return new Encryption\Keys\Storage($view, $util); |
| 265 | 265 | }); |
| 266 | - $this->registerService('TagMapper', function (Server $c) { |
|
| 266 | + $this->registerService('TagMapper', function(Server $c) { |
|
| 267 | 267 | return new TagMapper($c->getDatabaseConnection()); |
| 268 | 268 | }); |
| 269 | 269 | |
| 270 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
| 270 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
| 271 | 271 | $tagMapper = $c->query('TagMapper'); |
| 272 | 272 | return new TagManager($tagMapper, $c->getUserSession()); |
| 273 | 273 | }); |
| 274 | 274 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
| 275 | 275 | |
| 276 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
| 276 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
| 277 | 277 | $config = $c->getConfig(); |
| 278 | 278 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
| 279 | 279 | return new $factoryClass($this); |
| 280 | 280 | }); |
| 281 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
| 281 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
| 282 | 282 | return $c->query('SystemTagManagerFactory')->getManager(); |
| 283 | 283 | }); |
| 284 | 284 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
| 285 | 285 | |
| 286 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
| 286 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
| 287 | 287 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
| 288 | 288 | }); |
| 289 | - $this->registerService('RootFolder', function (Server $c) { |
|
| 289 | + $this->registerService('RootFolder', function(Server $c) { |
|
| 290 | 290 | $manager = \OC\Files\Filesystem::getMountManager(null); |
| 291 | 291 | $view = new View(); |
| 292 | 292 | $root = new Root( |
@@ -307,37 +307,37 @@ discard block |
||
| 307 | 307 | }); |
| 308 | 308 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
| 309 | 309 | |
| 310 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
| 311 | - return new LazyRoot(function () use ($c) { |
|
| 310 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
| 311 | + return new LazyRoot(function() use ($c) { |
|
| 312 | 312 | return $c->query('RootFolder'); |
| 313 | 313 | }); |
| 314 | 314 | }); |
| 315 | 315 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
| 316 | 316 | |
| 317 | - $this->registerService(\OC\User\Manager::class, function (Server $c) { |
|
| 317 | + $this->registerService(\OC\User\Manager::class, function(Server $c) { |
|
| 318 | 318 | return new \OC\User\Manager($c->getConfig(), $c->getEventDispatcher()); |
| 319 | 319 | }); |
| 320 | 320 | $this->registerAlias('UserManager', \OC\User\Manager::class); |
| 321 | 321 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
| 322 | 322 | |
| 323 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
| 323 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
| 324 | 324 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger()); |
| 325 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
| 325 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
| 326 | 326 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
| 327 | 327 | }); |
| 328 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
| 328 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
| 329 | 329 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
| 330 | 330 | }); |
| 331 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
| 331 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
| 332 | 332 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
| 333 | 333 | }); |
| 334 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
| 334 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
| 335 | 335 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
| 336 | 336 | }); |
| 337 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 337 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 338 | 338 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 339 | 339 | }); |
| 340 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 340 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 341 | 341 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 342 | 342 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
| 343 | 343 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | }); |
| 347 | 347 | $this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
| 348 | 348 | |
| 349 | - $this->registerService(Store::class, function (Server $c) { |
|
| 349 | + $this->registerService(Store::class, function(Server $c) { |
|
| 350 | 350 | $session = $c->getSession(); |
| 351 | 351 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
| 352 | 352 | $tokenProvider = $c->query(IProvider::class); |
@@ -357,13 +357,13 @@ discard block |
||
| 357 | 357 | return new Store($session, $logger, $tokenProvider); |
| 358 | 358 | }); |
| 359 | 359 | $this->registerAlias(IStore::class, Store::class); |
| 360 | - $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
| 360 | + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
| 361 | 361 | $dbConnection = $c->getDatabaseConnection(); |
| 362 | 362 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
| 363 | 363 | }); |
| 364 | 364 | $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
| 365 | 365 | |
| 366 | - $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
| 366 | + $this->registerService(\OC\User\Session::class, function(Server $c) { |
|
| 367 | 367 | $manager = $c->getUserManager(); |
| 368 | 368 | $session = new \OC\Session\Memory(''); |
| 369 | 369 | $timeFactory = new TimeFactory(); |
@@ -387,45 +387,45 @@ discard block |
||
| 387 | 387 | $c->getLockdownManager(), |
| 388 | 388 | $c->getLogger() |
| 389 | 389 | ); |
| 390 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
| 390 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
| 391 | 391 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 392 | 392 | }); |
| 393 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
| 393 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
| 394 | 394 | /** @var $user \OC\User\User */ |
| 395 | 395 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
| 396 | 396 | }); |
| 397 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
| 397 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
| 398 | 398 | /** @var $user \OC\User\User */ |
| 399 | 399 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
| 400 | 400 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
| 401 | 401 | }); |
| 402 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
| 402 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
| 403 | 403 | /** @var $user \OC\User\User */ |
| 404 | 404 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
| 405 | 405 | }); |
| 406 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 406 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
| 407 | 407 | /** @var $user \OC\User\User */ |
| 408 | 408 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 409 | 409 | }); |
| 410 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 410 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
| 411 | 411 | /** @var $user \OC\User\User */ |
| 412 | 412 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 413 | 413 | }); |
| 414 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
| 414 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
| 415 | 415 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 416 | 416 | }); |
| 417 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) { |
|
| 417 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) { |
|
| 418 | 418 | /** @var $user \OC\User\User */ |
| 419 | 419 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin)); |
| 420 | 420 | }); |
| 421 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
| 421 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
| 422 | 422 | /** @var $user \OC\User\User */ |
| 423 | 423 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
| 424 | 424 | }); |
| 425 | - $userSession->listen('\OC\User', 'logout', function () { |
|
| 425 | + $userSession->listen('\OC\User', 'logout', function() { |
|
| 426 | 426 | \OC_Hook::emit('OC_User', 'logout', array()); |
| 427 | 427 | }); |
| 428 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
| 428 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
| 429 | 429 | /** @var $user \OC\User\User */ |
| 430 | 430 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
| 431 | 431 | }); |
@@ -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, |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | $version = implode(',', $v); |
| 503 | 503 | $instanceId = \OC_Util::getInstanceId(); |
| 504 | 504 | $path = \OC::$SERVERROOT; |
| 505 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
| 505 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
| 506 | 506 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
| 507 | 507 | $config->getSystemValue('memcache.local', null), |
| 508 | 508 | $config->getSystemValue('memcache.distributed', null), |
@@ -515,12 +515,12 @@ discard block |
||
| 515 | 515 | $this->registerAlias('MemCacheFactory', Factory::class); |
| 516 | 516 | $this->registerAlias(ICacheFactory::class, Factory::class); |
| 517 | 517 | |
| 518 | - $this->registerService('RedisFactory', function (Server $c) { |
|
| 518 | + $this->registerService('RedisFactory', function(Server $c) { |
|
| 519 | 519 | $systemConfig = $c->getSystemConfig(); |
| 520 | 520 | return new RedisFactory($systemConfig); |
| 521 | 521 | }); |
| 522 | 522 | |
| 523 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
| 523 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
| 524 | 524 | return new \OC\Activity\Manager( |
| 525 | 525 | $c->getRequest(), |
| 526 | 526 | $c->getUserSession(), |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | }); |
| 531 | 531 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
| 532 | 532 | |
| 533 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
| 533 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
| 534 | 534 | return new \OC\Activity\EventMerger( |
| 535 | 535 | $c->getL10N('lib') |
| 536 | 536 | ); |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
| 553 | 553 | $this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
| 554 | 554 | |
| 555 | - $this->registerService(\OC\Log::class, function (Server $c) { |
|
| 555 | + $this->registerService(\OC\Log::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); |
@@ -563,11 +563,11 @@ discard block |
||
| 563 | 563 | $this->registerAlias(\OCP\ILogger::class, \OC\Log::class); |
| 564 | 564 | $this->registerAlias('Logger', \OC\Log::class); |
| 565 | 565 | |
| 566 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
| 566 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
| 567 | 567 | return new LogFactory($c, $this->getSystemConfig()); |
| 568 | 568 | }); |
| 569 | 569 | |
| 570 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
| 570 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
| 571 | 571 | $config = $c->getConfig(); |
| 572 | 572 | return new \OC\BackgroundJob\JobList( |
| 573 | 573 | $c->getDatabaseConnection(), |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | }); |
| 578 | 578 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
| 579 | 579 | |
| 580 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
| 580 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
| 581 | 581 | $cacheFactory = $c->getMemCacheFactory(); |
| 582 | 582 | $logger = $c->getLogger(); |
| 583 | 583 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -589,12 +589,12 @@ discard block |
||
| 589 | 589 | }); |
| 590 | 590 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
| 591 | 591 | |
| 592 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
| 592 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
| 593 | 593 | return new Search(); |
| 594 | 594 | }); |
| 595 | 595 | $this->registerAlias('Search', \OCP\ISearch::class); |
| 596 | 596 | |
| 597 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) { |
|
| 597 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) { |
|
| 598 | 598 | return new \OC\Security\RateLimiting\Limiter( |
| 599 | 599 | $this->getUserSession(), |
| 600 | 600 | $this->getRequest(), |
@@ -602,34 +602,34 @@ discard block |
||
| 602 | 602 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
| 603 | 603 | ); |
| 604 | 604 | }); |
| 605 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
| 605 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
| 606 | 606 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
| 607 | 607 | $this->getMemCacheFactory(), |
| 608 | 608 | new \OC\AppFramework\Utility\TimeFactory() |
| 609 | 609 | ); |
| 610 | 610 | }); |
| 611 | 611 | |
| 612 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
| 612 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
| 613 | 613 | return new SecureRandom(); |
| 614 | 614 | }); |
| 615 | 615 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
| 616 | 616 | |
| 617 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
| 617 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
| 618 | 618 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
| 619 | 619 | }); |
| 620 | 620 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
| 621 | 621 | |
| 622 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
| 622 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
| 623 | 623 | return new Hasher($c->getConfig()); |
| 624 | 624 | }); |
| 625 | 625 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
| 626 | 626 | |
| 627 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
| 627 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
| 628 | 628 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
| 629 | 629 | }); |
| 630 | 630 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
| 631 | 631 | |
| 632 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
| 632 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
| 633 | 633 | $systemConfig = $c->getSystemConfig(); |
| 634 | 634 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
| 635 | 635 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
| 645 | 645 | |
| 646 | 646 | |
| 647 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
| 647 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
| 648 | 648 | $user = \OC_User::getUser(); |
| 649 | 649 | $uid = $user ? $user : null; |
| 650 | 650 | return new ClientService( |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | ); |
| 660 | 660 | }); |
| 661 | 661 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
| 662 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
| 662 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
| 663 | 663 | $eventLogger = new EventLogger(); |
| 664 | 664 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 665 | 665 | // In debug mode, module is being activated by default |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | }); |
| 670 | 670 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
| 671 | 671 | |
| 672 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
| 672 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
| 673 | 673 | $queryLogger = new QueryLogger(); |
| 674 | 674 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 675 | 675 | // In debug mode, module is being activated by default |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | }); |
| 680 | 680 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
| 681 | 681 | |
| 682 | - $this->registerService(TempManager::class, function (Server $c) { |
|
| 682 | + $this->registerService(TempManager::class, function(Server $c) { |
|
| 683 | 683 | return new TempManager( |
| 684 | 684 | $c->getLogger(), |
| 685 | 685 | $c->getConfig() |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | $this->registerAlias('TempManager', TempManager::class); |
| 689 | 689 | $this->registerAlias(ITempManager::class, TempManager::class); |
| 690 | 690 | |
| 691 | - $this->registerService(AppManager::class, function (Server $c) { |
|
| 691 | + $this->registerService(AppManager::class, function(Server $c) { |
|
| 692 | 692 | return new \OC\App\AppManager( |
| 693 | 693 | $c->getUserSession(), |
| 694 | 694 | $c->query(\OC\AppConfig::class), |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | $this->registerAlias('AppManager', AppManager::class); |
| 702 | 702 | $this->registerAlias(IAppManager::class, AppManager::class); |
| 703 | 703 | |
| 704 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
| 704 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
| 705 | 705 | return new DateTimeZone( |
| 706 | 706 | $c->getConfig(), |
| 707 | 707 | $c->getSession() |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | }); |
| 710 | 710 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
| 711 | 711 | |
| 712 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
| 712 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
| 713 | 713 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
| 714 | 714 | |
| 715 | 715 | return new DateTimeFormatter( |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | }); |
| 720 | 720 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
| 721 | 721 | |
| 722 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
| 722 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
| 723 | 723 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
| 724 | 724 | $listener = new UserMountCacheListener($mountCache); |
| 725 | 725 | $listener->listen($c->getUserManager()); |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | }); |
| 728 | 728 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
| 729 | 729 | |
| 730 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
| 730 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
| 731 | 731 | $loader = \OC\Files\Filesystem::getLoader(); |
| 732 | 732 | $mountCache = $c->query('UserMountCache'); |
| 733 | 733 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -743,10 +743,10 @@ discard block |
||
| 743 | 743 | }); |
| 744 | 744 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
| 745 | 745 | |
| 746 | - $this->registerService('IniWrapper', function ($c) { |
|
| 746 | + $this->registerService('IniWrapper', function($c) { |
|
| 747 | 747 | return new IniGetWrapper(); |
| 748 | 748 | }); |
| 749 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
| 749 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
| 750 | 750 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
| 751 | 751 | if ($busClass) { |
| 752 | 752 | list($app, $class) = explode('::', $busClass, 2); |
@@ -761,10 +761,10 @@ discard block |
||
| 761 | 761 | return new CronBus($jobList); |
| 762 | 762 | } |
| 763 | 763 | }); |
| 764 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
| 764 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
| 765 | 765 | return new TrustedDomainHelper($this->getConfig()); |
| 766 | 766 | }); |
| 767 | - $this->registerService(Throttler::class, function (Server $c) { |
|
| 767 | + $this->registerService(Throttler::class, function(Server $c) { |
|
| 768 | 768 | return new Throttler( |
| 769 | 769 | $c->getDatabaseConnection(), |
| 770 | 770 | new TimeFactory(), |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | ); |
| 774 | 774 | }); |
| 775 | 775 | $this->registerAlias('Throttler', Throttler::class); |
| 776 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
| 776 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
| 777 | 777 | // IConfig and IAppManager requires a working database. This code |
| 778 | 778 | // might however be called when ownCloud is not yet setup. |
| 779 | 779 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | $c->getMimeTypeDetector() |
| 796 | 796 | ); |
| 797 | 797 | }); |
| 798 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
| 798 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
| 799 | 799 | if (isset($this['urlParams'])) { |
| 800 | 800 | $urlParams = $this['urlParams']; |
| 801 | 801 | } else { |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | }); |
| 832 | 832 | $this->registerAlias('Request', \OCP\IRequest::class); |
| 833 | 833 | |
| 834 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
| 834 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
| 835 | 835 | return new Mailer( |
| 836 | 836 | $c->getConfig(), |
| 837 | 837 | $c->getLogger(), |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | }); |
| 843 | 843 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
| 844 | 844 | |
| 845 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
| 845 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
| 846 | 846 | $config = $c->getConfig(); |
| 847 | 847 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
| 848 | 848 | if (is_null($factoryClass)) { |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | $factory = new $factoryClass($this); |
| 853 | 853 | return $factory->getLDAPProvider(); |
| 854 | 854 | }); |
| 855 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
| 855 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
| 856 | 856 | $ini = $c->getIniWrapper(); |
| 857 | 857 | $config = $c->getConfig(); |
| 858 | 858 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -875,30 +875,30 @@ discard block |
||
| 875 | 875 | }); |
| 876 | 876 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
| 877 | 877 | |
| 878 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
| 878 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
| 879 | 879 | return new \OC\Files\Mount\Manager(); |
| 880 | 880 | }); |
| 881 | 881 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
| 882 | 882 | |
| 883 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
| 883 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
| 884 | 884 | return new \OC\Files\Type\Detection( |
| 885 | 885 | $c->getURLGenerator(), |
| 886 | 886 | \OC::$configDir, |
| 887 | - \OC::$SERVERROOT . '/resources/config/' |
|
| 887 | + \OC::$SERVERROOT.'/resources/config/' |
|
| 888 | 888 | ); |
| 889 | 889 | }); |
| 890 | 890 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
| 891 | 891 | |
| 892 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
| 892 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
| 893 | 893 | return new \OC\Files\Type\Loader( |
| 894 | 894 | $c->getDatabaseConnection() |
| 895 | 895 | ); |
| 896 | 896 | }); |
| 897 | 897 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
| 898 | - $this->registerService(BundleFetcher::class, function () { |
|
| 898 | + $this->registerService(BundleFetcher::class, function() { |
|
| 899 | 899 | return new BundleFetcher($this->getL10N('lib')); |
| 900 | 900 | }); |
| 901 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
| 901 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
| 902 | 902 | return new Manager( |
| 903 | 903 | $c->query(IValidator::class), |
| 904 | 904 | $c->getLogger() |
@@ -906,19 +906,19 @@ discard block |
||
| 906 | 906 | }); |
| 907 | 907 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
| 908 | 908 | |
| 909 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
| 909 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
| 910 | 910 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
| 911 | - $manager->registerCapability(function () use ($c) { |
|
| 911 | + $manager->registerCapability(function() use ($c) { |
|
| 912 | 912 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
| 913 | 913 | }); |
| 914 | - $manager->registerCapability(function () use ($c) { |
|
| 914 | + $manager->registerCapability(function() use ($c) { |
|
| 915 | 915 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
| 916 | 916 | }); |
| 917 | 917 | return $manager; |
| 918 | 918 | }); |
| 919 | 919 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
| 920 | 920 | |
| 921 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
| 921 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
| 922 | 922 | $config = $c->getConfig(); |
| 923 | 923 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
| 924 | 924 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
| 929 | 929 | $manager = $c->getUserManager(); |
| 930 | 930 | $user = $manager->get($id); |
| 931 | - if(is_null($user)) { |
|
| 931 | + if (is_null($user)) { |
|
| 932 | 932 | $l = $c->getL10N('core'); |
| 933 | 933 | $displayName = $l->t('Unknown user'); |
| 934 | 934 | } else { |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | }); |
| 942 | 942 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
| 943 | 943 | |
| 944 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
| 944 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
| 945 | 945 | /* |
| 946 | 946 | * Dark magic for autoloader. |
| 947 | 947 | * If we do a class_exists it will try to load the class which will |
@@ -969,7 +969,7 @@ discard block |
||
| 969 | 969 | } |
| 970 | 970 | return new \OC_Defaults(); |
| 971 | 971 | }); |
| 972 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
| 972 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
| 973 | 973 | return new SCSSCacher( |
| 974 | 974 | $c->getLogger(), |
| 975 | 975 | $c->query(\OC\Files\AppData\Factory::class), |
@@ -982,7 +982,7 @@ discard block |
||
| 982 | 982 | new TimeFactory() |
| 983 | 983 | ); |
| 984 | 984 | }); |
| 985 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
| 985 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
| 986 | 986 | return new JSCombiner( |
| 987 | 987 | $c->getAppDataDir('js'), |
| 988 | 988 | $c->getURLGenerator(), |
@@ -995,7 +995,7 @@ discard block |
||
| 995 | 995 | $this->registerAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
| 996 | 996 | $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
| 997 | 997 | |
| 998 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
| 998 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
| 999 | 999 | // FIXME: Instantiiated here due to cyclic dependency |
| 1000 | 1000 | $request = new Request( |
| 1001 | 1001 | [ |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | $request |
| 1021 | 1021 | ); |
| 1022 | 1022 | }); |
| 1023 | - $this->registerService(CsrfTokenManager::class, function (Server $c) { |
|
| 1023 | + $this->registerService(CsrfTokenManager::class, function(Server $c) { |
|
| 1024 | 1024 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
| 1025 | 1025 | |
| 1026 | 1026 | return new CsrfTokenManager( |
@@ -1029,20 +1029,20 @@ discard block |
||
| 1029 | 1029 | ); |
| 1030 | 1030 | }); |
| 1031 | 1031 | $this->registerAlias('CsrfTokenManager', CsrfTokenManager::class); |
| 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 | 1035 | $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, \OC\Security\CSP\ContentSecurityPolicyManager::class); |
| 1036 | 1036 | $this->registerAlias('ContentSecurityPolicyManager', \OC\Security\CSP\ContentSecurityPolicyManager::class); |
| 1037 | 1037 | |
| 1038 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
| 1038 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
| 1039 | 1039 | return new ContentSecurityPolicyNonceManager( |
| 1040 | 1040 | $c->getCsrfTokenManager(), |
| 1041 | 1041 | $c->getRequest() |
| 1042 | 1042 | ); |
| 1043 | 1043 | }); |
| 1044 | 1044 | |
| 1045 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
| 1045 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
| 1046 | 1046 | $config = $c->getConfig(); |
| 1047 | 1047 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
| 1048 | 1048 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1089,7 +1089,7 @@ discard block |
||
| 1089 | 1089 | |
| 1090 | 1090 | $this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\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->getL10NFactory(), |
@@ -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(), |
@@ -1244,11 +1244,11 @@ discard block |
||
| 1244 | 1244 | // no avatar to remove |
| 1245 | 1245 | } catch (\Exception $e) { |
| 1246 | 1246 | // Ignore exceptions |
| 1247 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
| 1247 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
| 1248 | 1248 | } |
| 1249 | 1249 | }); |
| 1250 | 1250 | |
| 1251 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
| 1251 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
| 1252 | 1252 | $manager = $this->getAvatarManager(); |
| 1253 | 1253 | /** @var IUser $user */ |
| 1254 | 1254 | $user = $e->getSubject(); |
@@ -1404,7 +1404,7 @@ discard block |
||
| 1404 | 1404 | * @deprecated since 9.2.0 use IAppData |
| 1405 | 1405 | */ |
| 1406 | 1406 | public function getAppFolder() { |
| 1407 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
| 1407 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
| 1408 | 1408 | $root = $this->getRootFolder(); |
| 1409 | 1409 | if (!$root->nodeExists($dir)) { |
| 1410 | 1410 | $folder = $root->newFolder($dir); |
@@ -1979,7 +1979,7 @@ discard block |
||
| 1979 | 1979 | /** |
| 1980 | 1980 | * @return \OCP\Collaboration\AutoComplete\IManager |
| 1981 | 1981 | */ |
| 1982 | - public function getAutoCompleteManager(){ |
|
| 1982 | + public function getAutoCompleteManager() { |
|
| 1983 | 1983 | return $this->query(IManager::class); |
| 1984 | 1984 | } |
| 1985 | 1985 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public function registerNotifier(\Closure $service, \Closure $info) { |
| 85 | 85 | $infoData = $info(); |
| 86 | 86 | $this->logger->logException(new \InvalidArgumentException( |
| 87 | - 'Notifier ' . $infoData['name'] . ' (id: ' . $infoData['id'] . ') is not considered because it is using the old way to register.' |
|
| 87 | + 'Notifier '.$infoData['name'].' (id: '.$infoData['id'].') is not considered because it is using the old way to register.' |
|
| 88 | 88 | )); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -110,14 +110,14 @@ discard block |
||
| 110 | 110 | $app = \OC::$server->query($appClass); |
| 111 | 111 | } catch (QueryException $e) { |
| 112 | 112 | $this->logger->logException($e, [ |
| 113 | - 'message' => 'Failed to load notification app class: ' . $appClass, |
|
| 113 | + 'message' => 'Failed to load notification app class: '.$appClass, |
|
| 114 | 114 | 'app' => 'notifications', |
| 115 | 115 | ]); |
| 116 | 116 | continue; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if (!($app instanceof IApp)) { |
| 120 | - $this->logger->error('Notification app class ' . $appClass . ' is not implementing ' . IApp::class, [ |
|
| 120 | + $this->logger->error('Notification app class '.$appClass.' is not implementing '.IApp::class, [ |
|
| 121 | 121 | 'app' => 'notifications', |
| 122 | 122 | ]); |
| 123 | 123 | continue; |
@@ -144,14 +144,14 @@ discard block |
||
| 144 | 144 | $notifier = \OC::$server->query($notifierClass); |
| 145 | 145 | } catch (QueryException $e) { |
| 146 | 146 | $this->logger->logException($e, [ |
| 147 | - 'message' => 'Failed to load notification notifier class: ' . $notifierClass, |
|
| 147 | + 'message' => 'Failed to load notification notifier class: '.$notifierClass, |
|
| 148 | 148 | 'app' => 'notifications', |
| 149 | 149 | ]); |
| 150 | 150 | continue; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (!($notifier instanceof INotifier)) { |
| 154 | - $this->logger->error('Notification notifier class ' . $notifierClass . ' is not implementing ' . INotifier::class, [ |
|
| 154 | + $this->logger->error('Notification notifier class '.$notifierClass.' is not implementing '.INotifier::class, [ |
|
| 155 | 155 | 'app' => 'notifications', |
| 156 | 156 | ]); |
| 157 | 157 | continue; |