@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $this->config = $config; |
| 89 | 89 | $this->dispatcher = $oldDispatcher; |
| 90 | 90 | $cachedUsers = &$this->cachedUsers; |
| 91 | - $this->listen('\OC\User', 'postDelete', function ($user) use (&$cachedUsers) { |
|
| 91 | + $this->listen('\OC\User', 'postDelete', function($user) use (&$cachedUsers) { |
|
| 92 | 92 | /** @var \OC\User\User $user */ |
| 93 | 93 | unset($cachedUsers[$user->getUID()]); |
| 94 | 94 | }); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $result = $this->checkPasswordNoLogging($loginName, $password); |
| 200 | 200 | |
| 201 | 201 | if ($result === false) { |
| 202 | - \OC::$server->getLogger()->warning('Login failed: \''. $loginName .'\' (Remote IP: \''. \OC::$server->getRequest()->getRemoteAddress(). '\')', ['app' => 'core']); |
|
| 202 | + \OC::$server->getLogger()->warning('Login failed: \''.$loginName.'\' (Remote IP: \''.\OC::$server->getRequest()->getRemoteAddress().'\')', ['app' => 'core']); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | return $result; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - uasort($users, function ($a, $b) { |
|
| 251 | + uasort($users, function($a, $b) { |
|
| 252 | 252 | /** |
| 253 | 253 | * @var \OC\User\User $a |
| 254 | 254 | * @var \OC\User\User $b |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | - usort($users, function ($a, $b) { |
|
| 280 | + usort($users, function($a, $b) { |
|
| 281 | 281 | /** |
| 282 | 282 | * @var \OC\User\User $a |
| 283 | 283 | * @var \OC\User\User $b |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | $this->emit('\OC\User', 'preCreateUser', [$uid, $password]); |
| 362 | 362 | $this->eventDispatcher->dispatchTyped(new CreateUserEvent($uid, $password)); |
| 363 | 363 | $state = $backend->createUser($uid, $password); |
| 364 | - if($state === false) { |
|
| 364 | + if ($state === false) { |
|
| 365 | 365 | throw new \InvalidArgumentException($l->t('Could not create user')); |
| 366 | 366 | } |
| 367 | 367 | $user = $this->getUserObject($uid, $backend); |
@@ -388,13 +388,13 @@ discard block |
||
| 388 | 388 | foreach ($this->backends as $backend) { |
| 389 | 389 | if ($backend->implementsActions(Backend::COUNT_USERS)) { |
| 390 | 390 | $backendUsers = $backend->countUsers(); |
| 391 | - if($backendUsers !== false) { |
|
| 392 | - if($backend instanceof IUserBackend) { |
|
| 391 | + if ($backendUsers !== false) { |
|
| 392 | + if ($backend instanceof IUserBackend) { |
|
| 393 | 393 | $name = $backend->getBackendName(); |
| 394 | 394 | } else { |
| 395 | 395 | $name = get_class($backend); |
| 396 | 396 | } |
| 397 | - if(isset($userCountStatistics[$name])) { |
|
| 397 | + if (isset($userCountStatistics[$name])) { |
|
| 398 | 398 | $userCountStatistics[$name] += $backendUsers; |
| 399 | 399 | } else { |
| 400 | 400 | $userCountStatistics[$name] = $backendUsers; |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | */ |
| 415 | 415 | public function countUsersOfGroups(array $groups) { |
| 416 | 416 | $users = []; |
| 417 | - foreach($groups as $group) { |
|
| 417 | + foreach ($groups as $group) { |
|
| 418 | 418 | $usersIds = array_map(function($user) { |
| 419 | 419 | return $user->getUID(); |
| 420 | 420 | }, $group->getUsers()); |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $result->closeCursor(); |
| 479 | 479 | |
| 480 | 480 | if ($count !== false) { |
| 481 | - $count = (int)$count; |
|
| 481 | + $count = (int) $count; |
|
| 482 | 482 | } else { |
| 483 | 483 | $count = 0; |
| 484 | 484 | } |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | */ |
| 496 | 496 | public function countDisabledUsersOfGroups(array $groups): int { |
| 497 | 497 | $queryBuilder = \OC::$server->getDatabaseConnection()->getQueryBuilder(); |
| 498 | - $queryBuilder->select($queryBuilder->createFunction('COUNT(DISTINCT ' . $queryBuilder->getColumnName('uid') . ')')) |
|
| 498 | + $queryBuilder->select($queryBuilder->createFunction('COUNT(DISTINCT '.$queryBuilder->getColumnName('uid').')')) |
|
| 499 | 499 | ->from('preferences', 'p') |
| 500 | 500 | ->innerJoin('p', 'group_user', 'g', $queryBuilder->expr()->eq('p.userid', 'g.uid')) |
| 501 | 501 | ->where($queryBuilder->expr()->eq('appid', $queryBuilder->createNamedParameter('core'))) |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | $result->closeCursor(); |
| 509 | 509 | |
| 510 | 510 | if ($count !== false) { |
| 511 | - $count = (int)$count; |
|
| 511 | + $count = (int) $count; |
|
| 512 | 512 | } else { |
| 513 | 513 | $count = 0; |
| 514 | 514 | } |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | |
| 533 | 533 | $query = $queryBuilder->execute(); |
| 534 | 534 | |
| 535 | - $result = (int)$query->fetchColumn(); |
|
| 535 | + $result = (int) $query->fetchColumn(); |
|
| 536 | 536 | $query->closeCursor(); |
| 537 | 537 | |
| 538 | 538 | return $result; |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | private function verifyUid(string $uid): bool { |
| 624 | - $appdata = 'appdata_' . $this->config->getSystemValueString('instanceid'); |
|
| 624 | + $appdata = 'appdata_'.$this->config->getSystemValueString('instanceid'); |
|
| 625 | 625 | |
| 626 | 626 | if ($uid === '.htaccess' || $uid === 'files_external' || $uid === '.ocdata' || $uid === 'owncloud.log' || $uid === 'nextcloud.log' || $uid === $appdata) { |
| 627 | 627 | return false; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | // To find out if we are running from CLI or not |
| 184 | 184 | $this->registerParameter('isCLI', \OC::$CLI); |
| 185 | 185 | |
| 186 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
| 186 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
| 187 | 187 | return $c; |
| 188 | 188 | }); |
| 189 | 189 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
| 205 | 205 | |
| 206 | 206 | |
| 207 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
| 207 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
| 208 | 208 | return new PreviewManager( |
| 209 | 209 | $c->getConfig(), |
| 210 | 210 | $c->getRootFolder(), |
@@ -216,13 +216,13 @@ discard block |
||
| 216 | 216 | }); |
| 217 | 217 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
| 218 | 218 | |
| 219 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
| 219 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
| 220 | 220 | return new \OC\Preview\Watcher( |
| 221 | 221 | $c->getAppDataDir('preview') |
| 222 | 222 | ); |
| 223 | 223 | }); |
| 224 | 224 | |
| 225 | - $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
| 225 | + $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
|
| 226 | 226 | $view = new View(); |
| 227 | 227 | $util = new Encryption\Util( |
| 228 | 228 | $view, |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | }); |
| 242 | 242 | $this->registerAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
| 243 | 243 | |
| 244 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
| 244 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
| 245 | 245 | $util = new Encryption\Util( |
| 246 | 246 | new View(), |
| 247 | 247 | $c->getUserManager(), |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | ); |
| 256 | 256 | }); |
| 257 | 257 | |
| 258 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
| 258 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
| 259 | 259 | $view = new View(); |
| 260 | 260 | $util = new Encryption\Util( |
| 261 | 261 | $view, |
@@ -266,30 +266,30 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | return new Encryption\Keys\Storage($view, $util); |
| 268 | 268 | }); |
| 269 | - $this->registerService('TagMapper', function (Server $c) { |
|
| 269 | + $this->registerService('TagMapper', function(Server $c) { |
|
| 270 | 270 | return new TagMapper($c->getDatabaseConnection()); |
| 271 | 271 | }); |
| 272 | 272 | |
| 273 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
| 273 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
| 274 | 274 | $tagMapper = $c->query('TagMapper'); |
| 275 | 275 | return new TagManager($tagMapper, $c->getUserSession()); |
| 276 | 276 | }); |
| 277 | 277 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
| 278 | 278 | |
| 279 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
| 279 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
| 280 | 280 | $config = $c->getConfig(); |
| 281 | 281 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
| 282 | 282 | return new $factoryClass($this); |
| 283 | 283 | }); |
| 284 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
| 284 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
| 285 | 285 | return $c->query('SystemTagManagerFactory')->getManager(); |
| 286 | 286 | }); |
| 287 | 287 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
| 288 | 288 | |
| 289 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
| 289 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
| 290 | 290 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
| 291 | 291 | }); |
| 292 | - $this->registerService('RootFolder', function (Server $c) { |
|
| 292 | + $this->registerService('RootFolder', function(Server $c) { |
|
| 293 | 293 | $manager = \OC\Files\Filesystem::getMountManager(null); |
| 294 | 294 | $view = new View(); |
| 295 | 295 | $root = new Root( |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | }); |
| 311 | 311 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
| 312 | 312 | |
| 313 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
| 314 | - return new LazyRoot(function () use ($c) { |
|
| 313 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
| 314 | + return new LazyRoot(function() use ($c) { |
|
| 315 | 315 | return $c->query('RootFolder'); |
| 316 | 316 | }); |
| 317 | 317 | }); |
@@ -320,24 +320,24 @@ discard block |
||
| 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(); |
@@ -388,45 +388,45 @@ discard block |
||
| 388 | 388 | $c->getLogger(), |
| 389 | 389 | $c->query(IEventDispatcher::class) |
| 390 | 390 | ); |
| 391 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
| 391 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
| 392 | 392 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 393 | 393 | }); |
| 394 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
| 394 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
| 395 | 395 | /** @var $user \OC\User\User */ |
| 396 | 396 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
| 397 | 397 | }); |
| 398 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
| 398 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
| 399 | 399 | /** @var $user \OC\User\User */ |
| 400 | 400 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
| 401 | 401 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
| 402 | 402 | }); |
| 403 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
| 403 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
| 404 | 404 | /** @var $user \OC\User\User */ |
| 405 | 405 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
| 406 | 406 | }); |
| 407 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 407 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
| 408 | 408 | /** @var $user \OC\User\User */ |
| 409 | 409 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 410 | 410 | }); |
| 411 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 411 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
| 412 | 412 | /** @var $user \OC\User\User */ |
| 413 | 413 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 414 | 414 | }); |
| 415 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
| 415 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
| 416 | 416 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 417 | 417 | }); |
| 418 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) { |
|
| 418 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) { |
|
| 419 | 419 | /** @var $user \OC\User\User */ |
| 420 | 420 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin)); |
| 421 | 421 | }); |
| 422 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
| 422 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
| 423 | 423 | /** @var $user \OC\User\User */ |
| 424 | 424 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
| 425 | 425 | }); |
| 426 | - $userSession->listen('\OC\User', 'logout', function () { |
|
| 426 | + $userSession->listen('\OC\User', 'logout', function() { |
|
| 427 | 427 | \OC_Hook::emit('OC_User', 'logout', array()); |
| 428 | 428 | }); |
| 429 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
| 429 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
| 430 | 430 | /** @var $user \OC\User\User */ |
| 431 | 431 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
| 432 | 432 | }); |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
| 441 | 441 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
| 442 | 442 | |
| 443 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
| 443 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
| 444 | 444 | return new \OC\AllConfig( |
| 445 | 445 | $c->getSystemConfig() |
| 446 | 446 | ); |
@@ -448,18 +448,18 @@ discard block |
||
| 448 | 448 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
| 449 | 449 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
| 450 | 450 | |
| 451 | - $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
|
| 451 | + $this->registerService(\OC\SystemConfig::class, function($c) use ($config) { |
|
| 452 | 452 | return new \OC\SystemConfig($config); |
| 453 | 453 | }); |
| 454 | 454 | $this->registerAlias('SystemConfig', \OC\SystemConfig::class); |
| 455 | 455 | |
| 456 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
| 456 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
| 457 | 457 | return new \OC\AppConfig($c->getDatabaseConnection()); |
| 458 | 458 | }); |
| 459 | 459 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
| 460 | 460 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
| 461 | 461 | |
| 462 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
| 462 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
| 463 | 463 | return new \OC\L10N\Factory( |
| 464 | 464 | $c->getConfig(), |
| 465 | 465 | $c->getRequest(), |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | }); |
| 470 | 470 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
| 471 | 471 | |
| 472 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
| 472 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
| 473 | 473 | $config = $c->getConfig(); |
| 474 | 474 | $cacheFactory = $c->getMemCacheFactory(); |
| 475 | 475 | $request = $c->getRequest(); |
@@ -484,12 +484,12 @@ discard block |
||
| 484 | 484 | $this->registerAlias('AppFetcher', AppFetcher::class); |
| 485 | 485 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
| 486 | 486 | |
| 487 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
| 487 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
| 488 | 488 | return new Cache\File(); |
| 489 | 489 | }); |
| 490 | 490 | $this->registerAlias('UserCache', \OCP\ICache::class); |
| 491 | 491 | |
| 492 | - $this->registerService(Factory::class, function (Server $c) { |
|
| 492 | + $this->registerService(Factory::class, function(Server $c) { |
|
| 493 | 493 | |
| 494 | 494 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
| 495 | 495 | ArrayCache::class, |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | $version = implode(',', $v); |
| 505 | 505 | $instanceId = \OC_Util::getInstanceId(); |
| 506 | 506 | $path = \OC::$SERVERROOT; |
| 507 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
| 507 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
| 508 | 508 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
| 509 | 509 | $config->getSystemValue('memcache.local', null), |
| 510 | 510 | $config->getSystemValue('memcache.distributed', null), |
@@ -517,12 +517,12 @@ discard block |
||
| 517 | 517 | $this->registerAlias('MemCacheFactory', Factory::class); |
| 518 | 518 | $this->registerAlias(ICacheFactory::class, Factory::class); |
| 519 | 519 | |
| 520 | - $this->registerService('RedisFactory', function (Server $c) { |
|
| 520 | + $this->registerService('RedisFactory', function(Server $c) { |
|
| 521 | 521 | $systemConfig = $c->getSystemConfig(); |
| 522 | 522 | return new RedisFactory($systemConfig); |
| 523 | 523 | }); |
| 524 | 524 | |
| 525 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
| 525 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
| 526 | 526 | return new \OC\Activity\Manager( |
| 527 | 527 | $c->getRequest(), |
| 528 | 528 | $c->getUserSession(), |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | }); |
| 533 | 533 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
| 534 | 534 | |
| 535 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
| 535 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
| 536 | 536 | return new \OC\Activity\EventMerger( |
| 537 | 537 | $c->getL10N('lib') |
| 538 | 538 | ); |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
| 555 | 555 | $this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
| 556 | 556 | |
| 557 | - $this->registerService(\OC\Log::class, function (Server $c) { |
|
| 557 | + $this->registerService(\OC\Log::class, function(Server $c) { |
|
| 558 | 558 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
| 559 | 559 | $factory = new LogFactory($c, $this->getSystemConfig()); |
| 560 | 560 | $logger = $factory->get($logType); |
@@ -565,11 +565,11 @@ discard block |
||
| 565 | 565 | $this->registerAlias(\OCP\ILogger::class, \OC\Log::class); |
| 566 | 566 | $this->registerAlias('Logger', \OC\Log::class); |
| 567 | 567 | |
| 568 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
| 568 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
| 569 | 569 | return new LogFactory($c, $this->getSystemConfig()); |
| 570 | 570 | }); |
| 571 | 571 | |
| 572 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
| 572 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
| 573 | 573 | $config = $c->getConfig(); |
| 574 | 574 | return new \OC\BackgroundJob\JobList( |
| 575 | 575 | $c->getDatabaseConnection(), |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | }); |
| 580 | 580 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
| 581 | 581 | |
| 582 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
| 582 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
| 583 | 583 | $cacheFactory = $c->getMemCacheFactory(); |
| 584 | 584 | $logger = $c->getLogger(); |
| 585 | 585 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -591,39 +591,39 @@ discard block |
||
| 591 | 591 | }); |
| 592 | 592 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
| 593 | 593 | |
| 594 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
| 594 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
| 595 | 595 | return new Search(); |
| 596 | 596 | }); |
| 597 | 597 | $this->registerAlias('Search', \OCP\ISearch::class); |
| 598 | 598 | |
| 599 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
| 599 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
| 600 | 600 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
| 601 | 601 | $this->getMemCacheFactory(), |
| 602 | 602 | new \OC\AppFramework\Utility\TimeFactory() |
| 603 | 603 | ); |
| 604 | 604 | }); |
| 605 | 605 | |
| 606 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
| 606 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
| 607 | 607 | return new SecureRandom(); |
| 608 | 608 | }); |
| 609 | 609 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
| 610 | 610 | |
| 611 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
| 611 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
| 612 | 612 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
| 613 | 613 | }); |
| 614 | 614 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
| 615 | 615 | |
| 616 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
| 616 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
| 617 | 617 | return new Hasher($c->getConfig()); |
| 618 | 618 | }); |
| 619 | 619 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
| 620 | 620 | |
| 621 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
| 621 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
| 622 | 622 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
| 623 | 623 | }); |
| 624 | 624 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
| 625 | 625 | |
| 626 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
| 626 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
| 627 | 627 | $systemConfig = $c->getSystemConfig(); |
| 628 | 628 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
| 629 | 629 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
| 639 | 639 | |
| 640 | 640 | |
| 641 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
| 641 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
| 642 | 642 | $user = \OC_User::getUser(); |
| 643 | 643 | $uid = $user ? $user : null; |
| 644 | 644 | return new ClientService( |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | ); |
| 654 | 654 | }); |
| 655 | 655 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
| 656 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
| 656 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
| 657 | 657 | $eventLogger = new EventLogger(); |
| 658 | 658 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 659 | 659 | // In debug mode, module is being activated by default |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | }); |
| 664 | 664 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
| 665 | 665 | |
| 666 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
| 666 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
| 667 | 667 | $queryLogger = new QueryLogger(); |
| 668 | 668 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 669 | 669 | // In debug mode, module is being activated by default |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | }); |
| 674 | 674 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
| 675 | 675 | |
| 676 | - $this->registerService(TempManager::class, function (Server $c) { |
|
| 676 | + $this->registerService(TempManager::class, function(Server $c) { |
|
| 677 | 677 | return new TempManager( |
| 678 | 678 | $c->getLogger(), |
| 679 | 679 | $c->getConfig() |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | $this->registerAlias('TempManager', TempManager::class); |
| 683 | 683 | $this->registerAlias(ITempManager::class, TempManager::class); |
| 684 | 684 | |
| 685 | - $this->registerService(AppManager::class, function (Server $c) { |
|
| 685 | + $this->registerService(AppManager::class, function(Server $c) { |
|
| 686 | 686 | return new \OC\App\AppManager( |
| 687 | 687 | $c->getUserSession(), |
| 688 | 688 | $c->query(\OC\AppConfig::class), |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | $this->registerAlias('AppManager', AppManager::class); |
| 696 | 696 | $this->registerAlias(IAppManager::class, AppManager::class); |
| 697 | 697 | |
| 698 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
| 698 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
| 699 | 699 | return new DateTimeZone( |
| 700 | 700 | $c->getConfig(), |
| 701 | 701 | $c->getSession() |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | }); |
| 704 | 704 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
| 705 | 705 | |
| 706 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
| 706 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
| 707 | 707 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
| 708 | 708 | |
| 709 | 709 | return new DateTimeFormatter( |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | }); |
| 714 | 714 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
| 715 | 715 | |
| 716 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
| 716 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
| 717 | 717 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
| 718 | 718 | $listener = new UserMountCacheListener($mountCache); |
| 719 | 719 | $listener->listen($c->getUserManager()); |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | }); |
| 722 | 722 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
| 723 | 723 | |
| 724 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
| 724 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
| 725 | 725 | $loader = \OC\Files\Filesystem::getLoader(); |
| 726 | 726 | $mountCache = $c->query('UserMountCache'); |
| 727 | 727 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -737,10 +737,10 @@ discard block |
||
| 737 | 737 | }); |
| 738 | 738 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
| 739 | 739 | |
| 740 | - $this->registerService('IniWrapper', function ($c) { |
|
| 740 | + $this->registerService('IniWrapper', function($c) { |
|
| 741 | 741 | return new IniGetWrapper(); |
| 742 | 742 | }); |
| 743 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
| 743 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
| 744 | 744 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
| 745 | 745 | if ($busClass) { |
| 746 | 746 | list($app, $class) = explode('::', $busClass, 2); |
@@ -755,10 +755,10 @@ discard block |
||
| 755 | 755 | return new CronBus($jobList); |
| 756 | 756 | } |
| 757 | 757 | }); |
| 758 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
| 758 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
| 759 | 759 | return new TrustedDomainHelper($this->getConfig()); |
| 760 | 760 | }); |
| 761 | - $this->registerService(Throttler::class, function (Server $c) { |
|
| 761 | + $this->registerService(Throttler::class, function(Server $c) { |
|
| 762 | 762 | return new Throttler( |
| 763 | 763 | $c->getDatabaseConnection(), |
| 764 | 764 | new TimeFactory(), |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | ); |
| 768 | 768 | }); |
| 769 | 769 | $this->registerAlias('Throttler', Throttler::class); |
| 770 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
| 770 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
| 771 | 771 | // IConfig and IAppManager requires a working database. This code |
| 772 | 772 | // might however be called when ownCloud is not yet setup. |
| 773 | 773 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | $c->getMimeTypeDetector() |
| 790 | 790 | ); |
| 791 | 791 | }); |
| 792 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
| 792 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
| 793 | 793 | if (isset($this['urlParams'])) { |
| 794 | 794 | $urlParams = $this['urlParams']; |
| 795 | 795 | } else { |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | }); |
| 826 | 826 | $this->registerAlias('Request', \OCP\IRequest::class); |
| 827 | 827 | |
| 828 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
| 828 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
| 829 | 829 | return new Mailer( |
| 830 | 830 | $c->getConfig(), |
| 831 | 831 | $c->getLogger(), |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | }); |
| 837 | 837 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
| 838 | 838 | |
| 839 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
| 839 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
| 840 | 840 | $config = $c->getConfig(); |
| 841 | 841 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
| 842 | 842 | if (is_null($factoryClass)) { |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | $factory = new $factoryClass($this); |
| 847 | 847 | return $factory->getLDAPProvider(); |
| 848 | 848 | }); |
| 849 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
| 849 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
| 850 | 850 | $ini = $c->getIniWrapper(); |
| 851 | 851 | $config = $c->getConfig(); |
| 852 | 852 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -869,30 +869,30 @@ discard block |
||
| 869 | 869 | }); |
| 870 | 870 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
| 871 | 871 | |
| 872 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
| 872 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
| 873 | 873 | return new \OC\Files\Mount\Manager(); |
| 874 | 874 | }); |
| 875 | 875 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
| 876 | 876 | |
| 877 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
| 877 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
| 878 | 878 | return new \OC\Files\Type\Detection( |
| 879 | 879 | $c->getURLGenerator(), |
| 880 | 880 | \OC::$configDir, |
| 881 | - \OC::$SERVERROOT . '/resources/config/' |
|
| 881 | + \OC::$SERVERROOT.'/resources/config/' |
|
| 882 | 882 | ); |
| 883 | 883 | }); |
| 884 | 884 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
| 885 | 885 | |
| 886 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
| 886 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
| 887 | 887 | return new \OC\Files\Type\Loader( |
| 888 | 888 | $c->getDatabaseConnection() |
| 889 | 889 | ); |
| 890 | 890 | }); |
| 891 | 891 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
| 892 | - $this->registerService(BundleFetcher::class, function () { |
|
| 892 | + $this->registerService(BundleFetcher::class, function() { |
|
| 893 | 893 | return new BundleFetcher($this->getL10N('lib')); |
| 894 | 894 | }); |
| 895 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
| 895 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
| 896 | 896 | return new Manager( |
| 897 | 897 | $c->query(IValidator::class), |
| 898 | 898 | $c->getLogger() |
@@ -900,19 +900,19 @@ discard block |
||
| 900 | 900 | }); |
| 901 | 901 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
| 902 | 902 | |
| 903 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
| 903 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
| 904 | 904 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
| 905 | - $manager->registerCapability(function () use ($c) { |
|
| 905 | + $manager->registerCapability(function() use ($c) { |
|
| 906 | 906 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
| 907 | 907 | }); |
| 908 | - $manager->registerCapability(function () use ($c) { |
|
| 908 | + $manager->registerCapability(function() use ($c) { |
|
| 909 | 909 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
| 910 | 910 | }); |
| 911 | 911 | return $manager; |
| 912 | 912 | }); |
| 913 | 913 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
| 914 | 914 | |
| 915 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
| 915 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
| 916 | 916 | $config = $c->getConfig(); |
| 917 | 917 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
| 918 | 918 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
| 923 | 923 | $manager = $c->getUserManager(); |
| 924 | 924 | $user = $manager->get($id); |
| 925 | - if(is_null($user)) { |
|
| 925 | + if (is_null($user)) { |
|
| 926 | 926 | $l = $c->getL10N('core'); |
| 927 | 927 | $displayName = $l->t('Unknown user'); |
| 928 | 928 | } else { |
@@ -935,7 +935,7 @@ discard block |
||
| 935 | 935 | }); |
| 936 | 936 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
| 937 | 937 | |
| 938 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
| 938 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
| 939 | 939 | /* |
| 940 | 940 | * Dark magic for autoloader. |
| 941 | 941 | * If we do a class_exists it will try to load the class which will |
@@ -963,7 +963,7 @@ discard block |
||
| 963 | 963 | } |
| 964 | 964 | return new \OC_Defaults(); |
| 965 | 965 | }); |
| 966 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
| 966 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
| 967 | 967 | return new SCSSCacher( |
| 968 | 968 | $c->getLogger(), |
| 969 | 969 | $c->query(\OC\Files\AppData\Factory::class), |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | new TimeFactory() |
| 977 | 977 | ); |
| 978 | 978 | }); |
| 979 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
| 979 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
| 980 | 980 | return new JSCombiner( |
| 981 | 981 | $c->getAppDataDir('js'), |
| 982 | 982 | $c->getURLGenerator(), |
@@ -989,7 +989,7 @@ discard block |
||
| 989 | 989 | $this->registerAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
| 990 | 990 | $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
| 991 | 991 | |
| 992 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
| 992 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
| 993 | 993 | // FIXME: Instantiiated here due to cyclic dependency |
| 994 | 994 | $request = new Request( |
| 995 | 995 | [ |
@@ -1014,7 +1014,7 @@ discard block |
||
| 1014 | 1014 | $request |
| 1015 | 1015 | ); |
| 1016 | 1016 | }); |
| 1017 | - $this->registerService(CsrfTokenManager::class, function (Server $c) { |
|
| 1017 | + $this->registerService(CsrfTokenManager::class, function(Server $c) { |
|
| 1018 | 1018 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
| 1019 | 1019 | |
| 1020 | 1020 | return new CsrfTokenManager( |
@@ -1023,20 +1023,20 @@ discard block |
||
| 1023 | 1023 | ); |
| 1024 | 1024 | }); |
| 1025 | 1025 | $this->registerAlias('CsrfTokenManager', CsrfTokenManager::class); |
| 1026 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
| 1026 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
| 1027 | 1027 | return new SessionStorage($c->getSession()); |
| 1028 | 1028 | }); |
| 1029 | 1029 | $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, \OC\Security\CSP\ContentSecurityPolicyManager::class); |
| 1030 | 1030 | $this->registerAlias('ContentSecurityPolicyManager', \OC\Security\CSP\ContentSecurityPolicyManager::class); |
| 1031 | 1031 | |
| 1032 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
| 1032 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
| 1033 | 1033 | return new ContentSecurityPolicyNonceManager( |
| 1034 | 1034 | $c->getCsrfTokenManager(), |
| 1035 | 1035 | $c->getRequest() |
| 1036 | 1036 | ); |
| 1037 | 1037 | }); |
| 1038 | 1038 | |
| 1039 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
| 1039 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
| 1040 | 1040 | $config = $c->getConfig(); |
| 1041 | 1041 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
| 1042 | 1042 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1083,7 +1083,7 @@ discard block |
||
| 1083 | 1083 | |
| 1084 | 1084 | $this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class); |
| 1085 | 1085 | |
| 1086 | - $this->registerService('SettingsManager', function (Server $c) { |
|
| 1086 | + $this->registerService('SettingsManager', function(Server $c) { |
|
| 1087 | 1087 | $manager = new \OC\Settings\Manager( |
| 1088 | 1088 | $c->getLogger(), |
| 1089 | 1089 | $c->getL10NFactory(), |
@@ -1092,36 +1092,36 @@ discard block |
||
| 1092 | 1092 | ); |
| 1093 | 1093 | return $manager; |
| 1094 | 1094 | }); |
| 1095 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
| 1095 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
| 1096 | 1096 | return new \OC\Files\AppData\Factory( |
| 1097 | 1097 | $c->getRootFolder(), |
| 1098 | 1098 | $c->getSystemConfig() |
| 1099 | 1099 | ); |
| 1100 | 1100 | }); |
| 1101 | 1101 | |
| 1102 | - $this->registerService('LockdownManager', function (Server $c) { |
|
| 1103 | - return new LockdownManager(function () use ($c) { |
|
| 1102 | + $this->registerService('LockdownManager', function(Server $c) { |
|
| 1103 | + return new LockdownManager(function() use ($c) { |
|
| 1104 | 1104 | return $c->getSession(); |
| 1105 | 1105 | }); |
| 1106 | 1106 | }); |
| 1107 | 1107 | |
| 1108 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
| 1108 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
| 1109 | 1109 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
| 1110 | 1110 | }); |
| 1111 | 1111 | |
| 1112 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
| 1112 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
| 1113 | 1113 | return new CloudIdManager(); |
| 1114 | 1114 | }); |
| 1115 | 1115 | |
| 1116 | - $this->registerService(IConfig::class, function (Server $c) { |
|
| 1116 | + $this->registerService(IConfig::class, function(Server $c) { |
|
| 1117 | 1117 | return new GlobalScale\Config($c->getConfig()); |
| 1118 | 1118 | }); |
| 1119 | 1119 | |
| 1120 | - $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
| 1120 | + $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
| 1121 | 1121 | return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
| 1122 | 1122 | }); |
| 1123 | 1123 | |
| 1124 | - $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
| 1124 | + $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
| 1125 | 1125 | return new CloudFederationFactory(); |
| 1126 | 1126 | }); |
| 1127 | 1127 | |
@@ -1131,18 +1131,18 @@ discard block |
||
| 1131 | 1131 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
| 1132 | 1132 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
| 1133 | 1133 | |
| 1134 | - $this->registerService(Defaults::class, function (Server $c) { |
|
| 1134 | + $this->registerService(Defaults::class, function(Server $c) { |
|
| 1135 | 1135 | return new Defaults( |
| 1136 | 1136 | $c->getThemingDefaults() |
| 1137 | 1137 | ); |
| 1138 | 1138 | }); |
| 1139 | 1139 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
| 1140 | 1140 | |
| 1141 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
| 1141 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
| 1142 | 1142 | return $c->query(\OCP\IUserSession::class)->getSession(); |
| 1143 | 1143 | }); |
| 1144 | 1144 | |
| 1145 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
| 1145 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
| 1146 | 1146 | return new ShareHelper( |
| 1147 | 1147 | $c->query(\OCP\Share\IManager::class) |
| 1148 | 1148 | ); |
@@ -1230,11 +1230,11 @@ discard block |
||
| 1230 | 1230 | // no avatar to remove |
| 1231 | 1231 | } catch (\Exception $e) { |
| 1232 | 1232 | // Ignore exceptions |
| 1233 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
| 1233 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
| 1234 | 1234 | } |
| 1235 | 1235 | }); |
| 1236 | 1236 | |
| 1237 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
| 1237 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
| 1238 | 1238 | $manager = $this->getAvatarManager(); |
| 1239 | 1239 | /** @var IUser $user */ |
| 1240 | 1240 | $user = $e->getSubject(); |
@@ -1390,7 +1390,7 @@ discard block |
||
| 1390 | 1390 | * @deprecated since 9.2.0 use IAppData |
| 1391 | 1391 | */ |
| 1392 | 1392 | public function getAppFolder() { |
| 1393 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
| 1393 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
| 1394 | 1394 | $root = $this->getRootFolder(); |
| 1395 | 1395 | if (!$root->nodeExists($dir)) { |
| 1396 | 1396 | $folder = $root->newFolder($dir); |
@@ -1965,7 +1965,7 @@ discard block |
||
| 1965 | 1965 | /** |
| 1966 | 1966 | * @return \OCP\Collaboration\AutoComplete\IManager |
| 1967 | 1967 | */ |
| 1968 | - public function getAutoCompleteManager(){ |
|
| 1968 | + public function getAutoCompleteManager() { |
|
| 1969 | 1969 | return $this->query(IManager::class); |
| 1970 | 1970 | } |
| 1971 | 1971 | |