@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | class Manager implements IManager { |
31 | 31 | /** @var string[] */ |
32 | - protected $sorters =[]; |
|
32 | + protected $sorters = []; |
|
33 | 33 | |
34 | 34 | /** @var ISorter[] */ |
35 | 35 | protected $sorterInstances = []; |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | |
43 | 43 | public function runSorters(array $sorters, array &$sortArray, array $context) { |
44 | 44 | $sorterInstances = $this->getSorters(); |
45 | - while($sorter = array_shift($sorters)) { |
|
46 | - if(isset($sorterInstances[$sorter])) { |
|
45 | + while ($sorter = array_shift($sorters)) { |
|
46 | + if (isset($sorterInstances[$sorter])) { |
|
47 | 47 | $sorterInstances[$sorter]->sort($sortArray, $context); |
48 | 48 | } else { |
49 | 49 | $this->c->getLogger()->warning('No sorter for ID "{id}", skipping', [ |
@@ -58,17 +58,17 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | protected function getSorters() { |
61 | - if(count($this->sorterInstances) === 0) { |
|
61 | + if (count($this->sorterInstances) === 0) { |
|
62 | 62 | foreach ($this->sorters as $sorter) { |
63 | 63 | /** @var ISorter $instance */ |
64 | 64 | $instance = $this->c->resolve($sorter); |
65 | - if(!$instance instanceof ISorter) { |
|
65 | + if (!$instance instanceof ISorter) { |
|
66 | 66 | $this->c->getLogger()->notice('Skipping sorter which is not an instance of ISorter. Class name: {class}', |
67 | 67 | ['app' => 'core', 'class' => $sorter]); |
68 | 68 | continue; |
69 | 69 | } |
70 | 70 | $sorterId = trim($instance->getId()); |
71 | - if(trim($sorterId) === '') { |
|
71 | + if (trim($sorterId) === '') { |
|
72 | 72 | $this->c->getLogger()->notice('Skipping sorter with empty ID. Class name: {class}', |
73 | 73 | ['app' => 'core', 'class' => $sorter]); |
74 | 74 | continue; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | parent::__construct(); |
144 | 144 | $this->webRoot = $webRoot; |
145 | 145 | |
146 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
146 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
147 | 147 | return $c; |
148 | 148 | }); |
149 | 149 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
154 | 154 | |
155 | 155 | |
156 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
156 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
157 | 157 | return new PreviewManager( |
158 | 158 | $c->getConfig(), |
159 | 159 | $c->getRootFolder(), |
@@ -164,13 +164,13 @@ discard block |
||
164 | 164 | }); |
165 | 165 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
166 | 166 | |
167 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
167 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
168 | 168 | return new \OC\Preview\Watcher( |
169 | 169 | $c->getAppDataDir('preview') |
170 | 170 | ); |
171 | 171 | }); |
172 | 172 | |
173 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
173 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
174 | 174 | $view = new View(); |
175 | 175 | $util = new Encryption\Util( |
176 | 176 | $view, |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | ); |
189 | 189 | }); |
190 | 190 | |
191 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
191 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
192 | 192 | $util = new Encryption\Util( |
193 | 193 | new View(), |
194 | 194 | $c->getUserManager(), |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | ); |
203 | 203 | }); |
204 | 204 | |
205 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
205 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
206 | 206 | $view = new View(); |
207 | 207 | $util = new Encryption\Util( |
208 | 208 | $view, |
@@ -213,32 +213,32 @@ discard block |
||
213 | 213 | |
214 | 214 | return new Encryption\Keys\Storage($view, $util); |
215 | 215 | }); |
216 | - $this->registerService('TagMapper', function (Server $c) { |
|
216 | + $this->registerService('TagMapper', function(Server $c) { |
|
217 | 217 | return new TagMapper($c->getDatabaseConnection()); |
218 | 218 | }); |
219 | 219 | |
220 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
220 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
221 | 221 | $tagMapper = $c->query('TagMapper'); |
222 | 222 | return new TagManager($tagMapper, $c->getUserSession()); |
223 | 223 | }); |
224 | 224 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
225 | 225 | |
226 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
226 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
227 | 227 | $config = $c->getConfig(); |
228 | 228 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory'); |
229 | 229 | /** @var \OC\SystemTag\ManagerFactory $factory */ |
230 | 230 | $factory = new $factoryClass($this); |
231 | 231 | return $factory; |
232 | 232 | }); |
233 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
233 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
234 | 234 | return $c->query('SystemTagManagerFactory')->getManager(); |
235 | 235 | }); |
236 | 236 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
237 | 237 | |
238 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
238 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
239 | 239 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
240 | 240 | }); |
241 | - $this->registerService('RootFolder', function (Server $c) { |
|
241 | + $this->registerService('RootFolder', function(Server $c) { |
|
242 | 242 | $manager = \OC\Files\Filesystem::getMountManager(null); |
243 | 243 | $view = new View(); |
244 | 244 | $root = new Root( |
@@ -259,37 +259,37 @@ discard block |
||
259 | 259 | }); |
260 | 260 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
261 | 261 | |
262 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
263 | - return new LazyRoot(function () use ($c) { |
|
262 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
263 | + return new LazyRoot(function() use ($c) { |
|
264 | 264 | return $c->query('RootFolder'); |
265 | 265 | }); |
266 | 266 | }); |
267 | 267 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
268 | 268 | |
269 | - $this->registerService(\OCP\IUserManager::class, function (Server $c) { |
|
269 | + $this->registerService(\OCP\IUserManager::class, function(Server $c) { |
|
270 | 270 | $config = $c->getConfig(); |
271 | 271 | return new \OC\User\Manager($config); |
272 | 272 | }); |
273 | 273 | $this->registerAlias('UserManager', \OCP\IUserManager::class); |
274 | 274 | |
275 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
275 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
276 | 276 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
277 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
277 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
278 | 278 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
279 | 279 | }); |
280 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
280 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
281 | 281 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
282 | 282 | }); |
283 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
283 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
284 | 284 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
285 | 285 | }); |
286 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
286 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
287 | 287 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
288 | 288 | }); |
289 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
289 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
290 | 290 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
291 | 291 | }); |
292 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
292 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
293 | 293 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
294 | 294 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
295 | 295 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | }); |
299 | 299 | $this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
300 | 300 | |
301 | - $this->registerService(Store::class, function (Server $c) { |
|
301 | + $this->registerService(Store::class, function(Server $c) { |
|
302 | 302 | $session = $c->getSession(); |
303 | 303 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
304 | 304 | $tokenProvider = $c->query('OC\Authentication\Token\IProvider'); |
@@ -309,11 +309,11 @@ discard block |
||
309 | 309 | return new Store($session, $logger, $tokenProvider); |
310 | 310 | }); |
311 | 311 | $this->registerAlias(IStore::class, Store::class); |
312 | - $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) { |
|
312 | + $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) { |
|
313 | 313 | $dbConnection = $c->getDatabaseConnection(); |
314 | 314 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
315 | 315 | }); |
316 | - $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) { |
|
316 | + $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) { |
|
317 | 317 | $mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper'); |
318 | 318 | $crypto = $c->getCrypto(); |
319 | 319 | $config = $c->getConfig(); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | }); |
324 | 324 | $this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider'); |
325 | 325 | |
326 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
326 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
327 | 327 | $manager = $c->getUserManager(); |
328 | 328 | $session = new \OC\Session\Memory(''); |
329 | 329 | $timeFactory = new TimeFactory(); |
@@ -336,44 +336,44 @@ discard block |
||
336 | 336 | } |
337 | 337 | |
338 | 338 | $userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom(), $c->getLockdownManager()); |
339 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
339 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
340 | 340 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
341 | 341 | }); |
342 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
342 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
343 | 343 | /** @var $user \OC\User\User */ |
344 | 344 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
345 | 345 | }); |
346 | - $userSession->listen('\OC\User', 'preDelete', function ($user) { |
|
346 | + $userSession->listen('\OC\User', 'preDelete', function($user) { |
|
347 | 347 | /** @var $user \OC\User\User */ |
348 | 348 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
349 | 349 | }); |
350 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
350 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
351 | 351 | /** @var $user \OC\User\User */ |
352 | 352 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
353 | 353 | }); |
354 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
354 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
355 | 355 | /** @var $user \OC\User\User */ |
356 | 356 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
357 | 357 | }); |
358 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
358 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
359 | 359 | /** @var $user \OC\User\User */ |
360 | 360 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
361 | 361 | }); |
362 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
362 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
363 | 363 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
364 | 364 | }); |
365 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
365 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
366 | 366 | /** @var $user \OC\User\User */ |
367 | 367 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
368 | 368 | }); |
369 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
369 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
370 | 370 | /** @var $user \OC\User\User */ |
371 | 371 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
372 | 372 | }); |
373 | - $userSession->listen('\OC\User', 'logout', function () { |
|
373 | + $userSession->listen('\OC\User', 'logout', function() { |
|
374 | 374 | \OC_Hook::emit('OC_User', 'logout', array()); |
375 | 375 | }); |
376 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
376 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
377 | 377 | /** @var $user \OC\User\User */ |
378 | 378 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
379 | 379 | }); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | }); |
382 | 382 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
383 | 383 | |
384 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
384 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
385 | 385 | return new \OC\Authentication\TwoFactorAuth\Manager( |
386 | 386 | $c->getAppManager(), |
387 | 387 | $c->getSession(), |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
397 | 397 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
398 | 398 | |
399 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
399 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
400 | 400 | return new \OC\AllConfig( |
401 | 401 | $c->getSystemConfig() |
402 | 402 | ); |
@@ -404,17 +404,17 @@ discard block |
||
404 | 404 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
405 | 405 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
406 | 406 | |
407 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
407 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
408 | 408 | return new \OC\SystemConfig($config); |
409 | 409 | }); |
410 | 410 | |
411 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
411 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
412 | 412 | return new \OC\AppConfig($c->getDatabaseConnection()); |
413 | 413 | }); |
414 | 414 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
415 | 415 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
416 | 416 | |
417 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
417 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
418 | 418 | return new \OC\L10N\Factory( |
419 | 419 | $c->getConfig(), |
420 | 420 | $c->getRequest(), |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | }); |
425 | 425 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
426 | 426 | |
427 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
427 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
428 | 428 | $config = $c->getConfig(); |
429 | 429 | $cacheFactory = $c->getMemCacheFactory(); |
430 | 430 | $request = $c->getRequest(); |
@@ -436,18 +436,18 @@ discard block |
||
436 | 436 | }); |
437 | 437 | $this->registerAlias('URLGenerator', \OCP\IURLGenerator::class); |
438 | 438 | |
439 | - $this->registerService('AppHelper', function ($c) { |
|
439 | + $this->registerService('AppHelper', function($c) { |
|
440 | 440 | return new \OC\AppHelper(); |
441 | 441 | }); |
442 | 442 | $this->registerAlias('AppFetcher', AppFetcher::class); |
443 | 443 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
444 | 444 | |
445 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
445 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
446 | 446 | return new Cache\File(); |
447 | 447 | }); |
448 | 448 | $this->registerAlias('UserCache', \OCP\ICache::class); |
449 | 449 | |
450 | - $this->registerService(Factory::class, function (Server $c) { |
|
450 | + $this->registerService(Factory::class, function(Server $c) { |
|
451 | 451 | |
452 | 452 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
453 | 453 | '\\OC\\Memcache\\ArrayCache', |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | $version = implode(',', $v); |
465 | 465 | $instanceId = \OC_Util::getInstanceId(); |
466 | 466 | $path = \OC::$SERVERROOT; |
467 | - $prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . $urlGenerator->getBaseUrl()); |
|
467 | + $prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.$urlGenerator->getBaseUrl()); |
|
468 | 468 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
469 | 469 | $config->getSystemValue('memcache.local', null), |
470 | 470 | $config->getSystemValue('memcache.distributed', null), |
@@ -477,12 +477,12 @@ discard block |
||
477 | 477 | $this->registerAlias('MemCacheFactory', Factory::class); |
478 | 478 | $this->registerAlias(ICacheFactory::class, Factory::class); |
479 | 479 | |
480 | - $this->registerService('RedisFactory', function (Server $c) { |
|
480 | + $this->registerService('RedisFactory', function(Server $c) { |
|
481 | 481 | $systemConfig = $c->getSystemConfig(); |
482 | 482 | return new RedisFactory($systemConfig); |
483 | 483 | }); |
484 | 484 | |
485 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
485 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
486 | 486 | return new \OC\Activity\Manager( |
487 | 487 | $c->getRequest(), |
488 | 488 | $c->getUserSession(), |
@@ -492,14 +492,14 @@ discard block |
||
492 | 492 | }); |
493 | 493 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
494 | 494 | |
495 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
495 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
496 | 496 | return new \OC\Activity\EventMerger( |
497 | 497 | $c->getL10N('lib') |
498 | 498 | ); |
499 | 499 | }); |
500 | 500 | $this->registerAlias(IValidator::class, Validator::class); |
501 | 501 | |
502 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
502 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
503 | 503 | return new AvatarManager( |
504 | 504 | $c->getUserManager(), |
505 | 505 | $c->getAppDataDir('avatar'), |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | }); |
511 | 511 | $this->registerAlias('AvatarManager', \OCP\IAvatarManager::class); |
512 | 512 | |
513 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
513 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
514 | 514 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
515 | 515 | $logger = Log::getLogClass($logType); |
516 | 516 | call_user_func(array($logger, 'init')); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | }); |
520 | 520 | $this->registerAlias('Logger', \OCP\ILogger::class); |
521 | 521 | |
522 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
522 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
523 | 523 | $config = $c->getConfig(); |
524 | 524 | return new \OC\BackgroundJob\JobList( |
525 | 525 | $c->getDatabaseConnection(), |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | }); |
530 | 530 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
531 | 531 | |
532 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
532 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
533 | 533 | $cacheFactory = $c->getMemCacheFactory(); |
534 | 534 | $logger = $c->getLogger(); |
535 | 535 | if ($cacheFactory->isAvailable()) { |
@@ -541,12 +541,12 @@ discard block |
||
541 | 541 | }); |
542 | 542 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
543 | 543 | |
544 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
544 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
545 | 545 | return new Search(); |
546 | 546 | }); |
547 | 547 | $this->registerAlias('Search', \OCP\ISearch::class); |
548 | 548 | |
549 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function ($c) { |
|
549 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function($c) { |
|
550 | 550 | return new \OC\Security\RateLimiting\Limiter( |
551 | 551 | $this->getUserSession(), |
552 | 552 | $this->getRequest(), |
@@ -554,34 +554,34 @@ discard block |
||
554 | 554 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
555 | 555 | ); |
556 | 556 | }); |
557 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
557 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
558 | 558 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
559 | 559 | $this->getMemCacheFactory(), |
560 | 560 | new \OC\AppFramework\Utility\TimeFactory() |
561 | 561 | ); |
562 | 562 | }); |
563 | 563 | |
564 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
564 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
565 | 565 | return new SecureRandom(); |
566 | 566 | }); |
567 | 567 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
568 | 568 | |
569 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
569 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
570 | 570 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
571 | 571 | }); |
572 | 572 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
573 | 573 | |
574 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
574 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
575 | 575 | return new Hasher($c->getConfig()); |
576 | 576 | }); |
577 | 577 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
578 | 578 | |
579 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
579 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
580 | 580 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
581 | 581 | }); |
582 | 582 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
583 | 583 | |
584 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
584 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
585 | 585 | $systemConfig = $c->getSystemConfig(); |
586 | 586 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
587 | 587 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | }); |
596 | 596 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
597 | 597 | |
598 | - $this->registerService('HTTPHelper', function (Server $c) { |
|
598 | + $this->registerService('HTTPHelper', function(Server $c) { |
|
599 | 599 | $config = $c->getConfig(); |
600 | 600 | return new HTTPHelper( |
601 | 601 | $config, |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | ); |
604 | 604 | }); |
605 | 605 | |
606 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
606 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
607 | 607 | $user = \OC_User::getUser(); |
608 | 608 | $uid = $user ? $user : null; |
609 | 609 | return new ClientService( |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | ); |
619 | 619 | }); |
620 | 620 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
621 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
621 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
622 | 622 | $eventLogger = new EventLogger(); |
623 | 623 | if ($c->getSystemConfig()->getValue('debug', false)) { |
624 | 624 | // In debug mode, module is being activated by default |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | }); |
629 | 629 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
630 | 630 | |
631 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
631 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
632 | 632 | $queryLogger = new QueryLogger(); |
633 | 633 | if ($c->getSystemConfig()->getValue('debug', false)) { |
634 | 634 | // In debug mode, module is being activated by default |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | }); |
639 | 639 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
640 | 640 | |
641 | - $this->registerService(TempManager::class, function (Server $c) { |
|
641 | + $this->registerService(TempManager::class, function(Server $c) { |
|
642 | 642 | return new TempManager( |
643 | 643 | $c->getLogger(), |
644 | 644 | $c->getConfig() |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | $this->registerAlias('TempManager', TempManager::class); |
648 | 648 | $this->registerAlias(ITempManager::class, TempManager::class); |
649 | 649 | |
650 | - $this->registerService(AppManager::class, function (Server $c) { |
|
650 | + $this->registerService(AppManager::class, function(Server $c) { |
|
651 | 651 | return new \OC\App\AppManager( |
652 | 652 | $c->getUserSession(), |
653 | 653 | $c->getAppConfig(), |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | $this->registerAlias('AppManager', AppManager::class); |
660 | 660 | $this->registerAlias(IAppManager::class, AppManager::class); |
661 | 661 | |
662 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
662 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
663 | 663 | return new DateTimeZone( |
664 | 664 | $c->getConfig(), |
665 | 665 | $c->getSession() |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | }); |
668 | 668 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
669 | 669 | |
670 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
670 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
671 | 671 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
672 | 672 | |
673 | 673 | return new DateTimeFormatter( |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | }); |
678 | 678 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
679 | 679 | |
680 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
680 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
681 | 681 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
682 | 682 | $listener = new UserMountCacheListener($mountCache); |
683 | 683 | $listener->listen($c->getUserManager()); |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | }); |
686 | 686 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
687 | 687 | |
688 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
688 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
689 | 689 | $loader = \OC\Files\Filesystem::getLoader(); |
690 | 690 | $mountCache = $c->query('UserMountCache'); |
691 | 691 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -701,10 +701,10 @@ discard block |
||
701 | 701 | }); |
702 | 702 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
703 | 703 | |
704 | - $this->registerService('IniWrapper', function ($c) { |
|
704 | + $this->registerService('IniWrapper', function($c) { |
|
705 | 705 | return new IniGetWrapper(); |
706 | 706 | }); |
707 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
707 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
708 | 708 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
709 | 709 | if ($busClass) { |
710 | 710 | list($app, $class) = explode('::', $busClass, 2); |
@@ -719,10 +719,10 @@ discard block |
||
719 | 719 | return new CronBus($jobList); |
720 | 720 | } |
721 | 721 | }); |
722 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
722 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
723 | 723 | return new TrustedDomainHelper($this->getConfig()); |
724 | 724 | }); |
725 | - $this->registerService('Throttler', function (Server $c) { |
|
725 | + $this->registerService('Throttler', function(Server $c) { |
|
726 | 726 | return new Throttler( |
727 | 727 | $c->getDatabaseConnection(), |
728 | 728 | new TimeFactory(), |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | $c->getConfig() |
731 | 731 | ); |
732 | 732 | }); |
733 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
733 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
734 | 734 | // IConfig and IAppManager requires a working database. This code |
735 | 735 | // might however be called when ownCloud is not yet setup. |
736 | 736 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | $c->getTempManager() |
752 | 752 | ); |
753 | 753 | }); |
754 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
754 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
755 | 755 | if (isset($this['urlParams'])) { |
756 | 756 | $urlParams = $this['urlParams']; |
757 | 757 | } else { |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | }); |
788 | 788 | $this->registerAlias('Request', \OCP\IRequest::class); |
789 | 789 | |
790 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
790 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
791 | 791 | return new Mailer( |
792 | 792 | $c->getConfig(), |
793 | 793 | $c->getLogger(), |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | }); |
799 | 799 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
800 | 800 | |
801 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
801 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
802 | 802 | $config = $c->getConfig(); |
803 | 803 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
804 | 804 | if (is_null($factoryClass)) { |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | $factory = new $factoryClass($this); |
809 | 809 | return $factory->getLDAPProvider(); |
810 | 810 | }); |
811 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
811 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
812 | 812 | $ini = $c->getIniWrapper(); |
813 | 813 | $config = $c->getConfig(); |
814 | 814 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -825,49 +825,49 @@ discard block |
||
825 | 825 | }); |
826 | 826 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
827 | 827 | |
828 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
828 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
829 | 829 | return new \OC\Files\Mount\Manager(); |
830 | 830 | }); |
831 | 831 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
832 | 832 | |
833 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
833 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
834 | 834 | return new \OC\Files\Type\Detection( |
835 | 835 | $c->getURLGenerator(), |
836 | 836 | \OC::$configDir, |
837 | - \OC::$SERVERROOT . '/resources/config/' |
|
837 | + \OC::$SERVERROOT.'/resources/config/' |
|
838 | 838 | ); |
839 | 839 | }); |
840 | 840 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
841 | 841 | |
842 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
842 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
843 | 843 | return new \OC\Files\Type\Loader( |
844 | 844 | $c->getDatabaseConnection() |
845 | 845 | ); |
846 | 846 | }); |
847 | 847 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
848 | - $this->registerService(BundleFetcher::class, function () { |
|
848 | + $this->registerService(BundleFetcher::class, function() { |
|
849 | 849 | return new BundleFetcher($this->getL10N('lib')); |
850 | 850 | }); |
851 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
851 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
852 | 852 | return new Manager( |
853 | 853 | $c->query(IValidator::class) |
854 | 854 | ); |
855 | 855 | }); |
856 | 856 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
857 | 857 | |
858 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
858 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
859 | 859 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
860 | - $manager->registerCapability(function () use ($c) { |
|
860 | + $manager->registerCapability(function() use ($c) { |
|
861 | 861 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
862 | 862 | }); |
863 | - $manager->registerCapability(function () use ($c) { |
|
863 | + $manager->registerCapability(function() use ($c) { |
|
864 | 864 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
865 | 865 | }); |
866 | 866 | return $manager; |
867 | 867 | }); |
868 | 868 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
869 | 869 | |
870 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
870 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
871 | 871 | $config = $c->getConfig(); |
872 | 872 | $factoryClass = $config->getSystemValue('comments.managerFactory', '\OC\Comments\ManagerFactory'); |
873 | 873 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | }); |
877 | 877 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
878 | 878 | |
879 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
879 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
880 | 880 | /* |
881 | 881 | * Dark magic for autoloader. |
882 | 882 | * If we do a class_exists it will try to load the class which will |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | } |
904 | 904 | return new \OC_Defaults(); |
905 | 905 | }); |
906 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
906 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
907 | 907 | /** @var Factory $cacheFactory */ |
908 | 908 | $cacheFactory = $c->query(Factory::class); |
909 | 909 | return new SCSSCacher( |
@@ -916,13 +916,13 @@ discard block |
||
916 | 916 | $cacheFactory->create('SCSS') |
917 | 917 | ); |
918 | 918 | }); |
919 | - $this->registerService(EventDispatcher::class, function () { |
|
919 | + $this->registerService(EventDispatcher::class, function() { |
|
920 | 920 | return new EventDispatcher(); |
921 | 921 | }); |
922 | 922 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
923 | 923 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
924 | 924 | |
925 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
925 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
926 | 926 | // FIXME: Instantiiated here due to cyclic dependency |
927 | 927 | $request = new Request( |
928 | 928 | [ |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | $request |
948 | 948 | ); |
949 | 949 | }); |
950 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
950 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
951 | 951 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
952 | 952 | |
953 | 953 | return new CsrfTokenManager( |
@@ -955,22 +955,22 @@ discard block |
||
955 | 955 | $c->query(SessionStorage::class) |
956 | 956 | ); |
957 | 957 | }); |
958 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
958 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
959 | 959 | return new SessionStorage($c->getSession()); |
960 | 960 | }); |
961 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
961 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
962 | 962 | return new ContentSecurityPolicyManager(); |
963 | 963 | }); |
964 | 964 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
965 | 965 | |
966 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
966 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
967 | 967 | return new ContentSecurityPolicyNonceManager( |
968 | 968 | $c->getCsrfTokenManager(), |
969 | 969 | $c->getRequest() |
970 | 970 | ); |
971 | 971 | }); |
972 | 972 | |
973 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
973 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
974 | 974 | $config = $c->getConfig(); |
975 | 975 | $factoryClass = $config->getSystemValue('sharing.managerFactory', '\OC\Share20\ProviderFactory'); |
976 | 976 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1011,12 +1011,12 @@ discard block |
||
1011 | 1011 | }); |
1012 | 1012 | $this->registerAlias('CollaboratorSearch', \OCP\Collaboration\Collaborators\ISearch::class); |
1013 | 1013 | |
1014 | - $this->registerService(\OCP\Collaboration\AutoComplete\IManager::class, function (Server $c) { |
|
1014 | + $this->registerService(\OCP\Collaboration\AutoComplete\IManager::class, function(Server $c) { |
|
1015 | 1015 | return new Collaboration\AutoComplete\Manager($c); |
1016 | 1016 | }); |
1017 | 1017 | $this->registerAlias('AutoCompleteManager', \OCP\Collaboration\AutoComplete\IManager::class); |
1018 | 1018 | |
1019 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1019 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1020 | 1020 | $manager = new \OC\Settings\Manager( |
1021 | 1021 | $c->getLogger(), |
1022 | 1022 | $c->getDatabaseConnection(), |
@@ -1036,29 +1036,29 @@ discard block |
||
1036 | 1036 | ); |
1037 | 1037 | return $manager; |
1038 | 1038 | }); |
1039 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1039 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1040 | 1040 | return new \OC\Files\AppData\Factory( |
1041 | 1041 | $c->getRootFolder(), |
1042 | 1042 | $c->getSystemConfig() |
1043 | 1043 | ); |
1044 | 1044 | }); |
1045 | 1045 | |
1046 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1047 | - return new LockdownManager(function () use ($c) { |
|
1046 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1047 | + return new LockdownManager(function() use ($c) { |
|
1048 | 1048 | return $c->getSession(); |
1049 | 1049 | }); |
1050 | 1050 | }); |
1051 | 1051 | |
1052 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1052 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1053 | 1053 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1054 | 1054 | }); |
1055 | 1055 | |
1056 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1056 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1057 | 1057 | return new CloudIdManager(); |
1058 | 1058 | }); |
1059 | 1059 | |
1060 | 1060 | /* To trick DI since we don't extend the DIContainer here */ |
1061 | - $this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) { |
|
1061 | + $this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) { |
|
1062 | 1062 | return new CleanPreviewsBackgroundJob( |
1063 | 1063 | $c->getRootFolder(), |
1064 | 1064 | $c->getLogger(), |
@@ -1073,18 +1073,18 @@ discard block |
||
1073 | 1073 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1074 | 1074 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1075 | 1075 | |
1076 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1076 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1077 | 1077 | return new Defaults( |
1078 | 1078 | $c->getThemingDefaults() |
1079 | 1079 | ); |
1080 | 1080 | }); |
1081 | 1081 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
1082 | 1082 | |
1083 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1083 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1084 | 1084 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1085 | 1085 | }); |
1086 | 1086 | |
1087 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1087 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1088 | 1088 | return new ShareHelper( |
1089 | 1089 | $c->query(\OCP\Share\IManager::class) |
1090 | 1090 | ); |
@@ -1225,7 +1225,7 @@ discard block |
||
1225 | 1225 | * @deprecated since 9.2.0 use IAppData |
1226 | 1226 | */ |
1227 | 1227 | public function getAppFolder() { |
1228 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1228 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1229 | 1229 | $root = $this->getRootFolder(); |
1230 | 1230 | if (!$root->nodeExists($dir)) { |
1231 | 1231 | $folder = $root->newFolder($dir); |
@@ -1809,7 +1809,7 @@ discard block |
||
1809 | 1809 | /** |
1810 | 1810 | * @return \OCP\Collaboration\AutoComplete\IManager |
1811 | 1811 | */ |
1812 | - public function getAutoCompleteManager(){ |
|
1812 | + public function getAutoCompleteManager() { |
|
1813 | 1813 | return $this->query('AutoCompleteManager'); |
1814 | 1814 | } |
1815 | 1815 |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | !is_string($type) || empty($type) |
191 | 191 | || !is_string($id) || empty($id) |
192 | 192 | ) { |
193 | - throw new \InvalidArgumentException($role . ' parameters must be string and not empty'); |
|
193 | + throw new \InvalidArgumentException($role.' parameters must be string and not empty'); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
@@ -363,10 +363,10 @@ discard block |
||
363 | 363 | * |
364 | 364 | */ |
365 | 365 | protected function extractActor(IComment $comment, &$actors) { |
366 | - if(!isset($actors[$comment->getActorType()])) { |
|
366 | + if (!isset($actors[$comment->getActorType()])) { |
|
367 | 367 | $actors[$comment->getActorType()] = []; |
368 | 368 | } |
369 | - if(!isset($actors[$comment->getActorType()][$comment->getActorId()])) { |
|
369 | + if (!isset($actors[$comment->getActorType()][$comment->getActorId()])) { |
|
370 | 370 | $actors[$comment->getActorType()][$comment->getActorId()] = 1; |
371 | 371 | } else { |
372 | 372 | $actors[$comment->getActorType()][$comment->getActorId()] += 1; |
@@ -383,12 +383,12 @@ discard block |
||
383 | 383 | * @param array|null $parameters |
384 | 384 | */ |
385 | 385 | protected function walkTree($node, array &$results, callable $callback, array $parameters = null) { |
386 | - if(isset($node['replies'])) { |
|
386 | + if (isset($node['replies'])) { |
|
387 | 387 | foreach ($node['replies'] as $subNode) { |
388 | 388 | $this->walkTree($subNode, $results, $callback, $parameters); |
389 | 389 | } |
390 | 390 | } |
391 | - if(isset($node['comment']) && $node['comment'] instanceof IComment) { |
|
391 | + if (isset($node['comment']) && $node['comment'] instanceof IComment) { |
|
392 | 392 | $callback($node['comment'], $results, $parameters); |
393 | 393 | } |
394 | 394 | } |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $qb = $this->dbConn->getQueryBuilder(); |
490 | 490 | $query = $qb->select('f.fileid') |
491 | 491 | ->selectAlias( |
492 | - $qb->createFunction('COUNT(' . $qb->getColumnName('c.id') . ')'), |
|
492 | + $qb->createFunction('COUNT('.$qb->getColumnName('c.id').')'), |
|
493 | 493 | 'num_ids' |
494 | 494 | ) |
495 | 495 | ->from('comments', 'c') |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | * @param IComment $comment |
623 | 623 | * @return bool |
624 | 624 | */ |
625 | - protected function insert(IComment &$comment) { |
|
625 | + protected function insert(IComment & $comment) { |
|
626 | 626 | $qb = $this->dbConn->getQueryBuilder(); |
627 | 627 | $affectedRows = $qb |
628 | 628 | ->insert('comments') |
@@ -922,7 +922,7 @@ discard block |
||
922 | 922 | if (!isset($this->displayNameResolvers[$type])) { |
923 | 923 | throw new \OutOfBoundsException('No Displayname resolver for this type registered'); |
924 | 924 | } |
925 | - return (string)$this->displayNameResolvers[$type]($id); |
|
925 | + return (string) $this->displayNameResolvers[$type]($id); |
|
926 | 926 | } |
927 | 927 | |
928 | 928 | /** |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function sort(array &$sortArray, array $context) { |
51 | 51 | $commenters = $this->retrieveCommentsInformation($context['itemType'], $context['itemId']); |
52 | - if(count($commenters) === 0) { |
|
52 | + if (count($commenters) === 0) { |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
56 | 56 | foreach ($sortArray as $type => &$byType) { |
57 | - if(!isset($commenters[$type])) { |
|
57 | + if (!isset($commenters[$type])) { |
|
58 | 58 | continue; |
59 | 59 | } |
60 | 60 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | return [$i++, $element]; |
66 | 66 | }, $byType); |
67 | 67 | |
68 | - usort($workArray, function ($a, $b) use ($commenters, $type) { |
|
68 | + usort($workArray, function($a, $b) use ($commenters, $type) { |
|
69 | 69 | $r = $this->compare($a[1], $b[1], $commenters[$type]); |
70 | - if($r === 0) { |
|
70 | + if ($r === 0) { |
|
71 | 71 | $r = $a[0] - $b[0]; |
72 | 72 | } |
73 | 73 | return $r; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | protected function retrieveCommentsInformation($type, $id) { |
87 | 87 | $comments = $this->commentsManager->getForObject($type, $id, 1); |
88 | - if(count($comments) === 0) { |
|
88 | + if (count($comments) === 0) { |
|
89 | 89 | return []; |
90 | 90 | } |
91 | 91 |
@@ -47,18 +47,18 @@ discard block |
||
47 | 47 | |
48 | 48 | public function sort(array &$sortArray, array $context) { |
49 | 49 | // let's be tolerant. Comments uses "files" by default, other usages are often singular |
50 | - if($context['itemType'] !== 'files' && $context['itemType'] !== 'file') { |
|
50 | + if ($context['itemType'] !== 'files' && $context['itemType'] !== 'file') { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | /** @var Node[] $nodes */ |
54 | - $nodes = $this->userFolder->getById((int)$context['itemId']); |
|
55 | - if(count($nodes) === 0) { |
|
54 | + $nodes = $this->userFolder->getById((int) $context['itemId']); |
|
55 | + if (count($nodes) === 0) { |
|
56 | 56 | return; |
57 | 57 | } |
58 | 58 | $al = $this->shareManager->getAccessList($nodes[0]); |
59 | 59 | |
60 | 60 | foreach ($sortArray as $type => &$byType) { |
61 | - if(!isset($al[$type]) || !is_array($al[$type])) { |
|
61 | + if (!isset($al[$type]) || !is_array($al[$type])) { |
|
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | return [$i++, $element]; |
70 | 70 | }, $byType); |
71 | 71 | |
72 | - usort($workArray, function ($a, $b) use ($al, $type) { |
|
72 | + usort($workArray, function($a, $b) use ($al, $type) { |
|
73 | 73 | $result = $this->compare($a[1], $b[1], $al[$type]); |
74 | - if($result === 0) { |
|
74 | + if ($result === 0) { |
|
75 | 75 | $result = $a[0] - $b[0]; |
76 | 76 | } |
77 | 77 | return $result; |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | $a = $a['value']['shareWith']; |
93 | 93 | $b = $b['value']['shareWith']; |
94 | 94 | |
95 | - $valueA = (int)in_array($a, $al, true); |
|
96 | - $valueB = (int)in_array($b, $al, true); |
|
95 | + $valueA = (int) in_array($a, $al, true); |
|
96 | + $valueB = (int) in_array($b, $al, true); |
|
97 | 97 | |
98 | 98 | return $valueB - $valueA; |
99 | 99 | } |