@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | // interpolate $message as defined in PSR-3 |
211 | 211 | $replace = []; |
212 | 212 | foreach ($context as $key => $val) { |
213 | - $replace['{' . $key . '}'] = $val; |
|
213 | + $replace['{'.$key.'}'] = $val; |
|
214 | 214 | } |
215 | 215 | $message = strtr($message, $replace); |
216 | 216 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | } |
318 | 318 | |
319 | 319 | public function getLogPath():string { |
320 | - if($this->logger instanceof IFileBased) { |
|
320 | + if ($this->logger instanceof IFileBased) { |
|
321 | 321 | return $this->logger->getLogFilePath(); |
322 | 322 | } |
323 | 323 | throw new \RuntimeException('Log implementation has no path'); |
@@ -26,5 +26,5 @@ |
||
26 | 26 | interface IFileBased { |
27 | 27 | public function getLogFilePath(); |
28 | 28 | |
29 | - public function getEntries($limit=50, $offset=0); |
|
29 | + public function getEntries($limit = 50, $offset = 0); |
|
30 | 30 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @return StreamResponse |
56 | 56 | */ |
57 | 57 | public function download() { |
58 | - if(!$this->log instanceof Log) { |
|
58 | + if (!$this->log instanceof Log) { |
|
59 | 59 | throw new \UnexpectedValueException('Log file not available'); |
60 | 60 | } |
61 | 61 | $resp = new StreamResponse($this->log->getLogPath()); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function __construct(string $path, string $fallbackPath = '', IConfig $config) { |
55 | 55 | $this->logFile = $path; |
56 | 56 | if (!file_exists($this->logFile)) { |
57 | - if( |
|
57 | + if ( |
|
58 | 58 | ( |
59 | 59 | !is_writable(dirname($this->logFile)) |
60 | 60 | || !touch($this->logFile) |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $time = $time->format($format); |
97 | 97 | $url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--'; |
98 | 98 | $method = is_string($request->getMethod()) ? $request->getMethod() : '--'; |
99 | - if($this->config->getSystemValue('installed', false)) { |
|
99 | + if ($this->config->getSystemValue('installed', false)) { |
|
100 | 100 | $user = \OC_User::getUser() ? \OC_User::getUser() : '--'; |
101 | 101 | } else { |
102 | 102 | $user = '--'; |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | // PHP's json_encode only accept proper UTF-8 strings, loop over all |
123 | 123 | // elements to ensure that they are properly UTF-8 compliant or convert |
124 | 124 | // them manually. |
125 | - foreach($entry as $key => $value) { |
|
126 | - if(is_string($value)) { |
|
125 | + foreach ($entry as $key => $value) { |
|
126 | + if (is_string($value)) { |
|
127 | 127 | $testEncode = json_encode($value); |
128 | - if($testEncode === false) { |
|
128 | + if ($testEncode === false) { |
|
129 | 129 | $entry[$key] = utf8_encode($value); |
130 | 130 | } |
131 | 131 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @param int $offset |
154 | 154 | * @return array |
155 | 155 | */ |
156 | - public function getEntries($limit=50, $offset=0) { |
|
156 | + public function getEntries($limit = 50, $offset = 0) { |
|
157 | 157 | $minLevel = $this->config->getSystemValue("loglevel", \OCP\Util::WARN); |
158 | 158 | $entries = array(); |
159 | 159 | $handle = @fopen($this->logFile, 'rb'); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $entriesCount = 0; |
165 | 165 | $lines = 0; |
166 | 166 | // Loop through each character of the file looking for new lines |
167 | - while ($pos >= 0 && ($limit === null ||$entriesCount < $limit)) { |
|
167 | + while ($pos >= 0 && ($limit === null || $entriesCount < $limit)) { |
|
168 | 168 | fseek($handle, $pos); |
169 | 169 | $ch = fgetc($handle); |
170 | 170 | if ($ch == "\n" || $pos == 0) { |
@@ -67,7 +67,7 @@ |
||
67 | 67 | protected function buildLogFile(string $logFile = ''):File { |
68 | 68 | $config = $this->c->getConfig(); |
69 | 69 | $defaultLogFile = $config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/nextcloud.log'; |
70 | - if($logFile === '') { |
|
70 | + if ($logFile === '') { |
|
71 | 71 | $logFile = $config->getSystemValue('logfile', $defaultLogFile); |
72 | 72 | } |
73 | 73 | $fallback = $defaultLogFile !== $logFile ? $defaultLogFile : ''; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | parent::__construct(); |
164 | 164 | $this->webRoot = $webRoot; |
165 | 165 | |
166 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
166 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
167 | 167 | return $c; |
168 | 168 | }); |
169 | 169 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
177 | 177 | |
178 | 178 | |
179 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
179 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
180 | 180 | return new PreviewManager( |
181 | 181 | $c->getConfig(), |
182 | 182 | $c->getRootFolder(), |
@@ -187,13 +187,13 @@ discard block |
||
187 | 187 | }); |
188 | 188 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
189 | 189 | |
190 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
190 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
191 | 191 | return new \OC\Preview\Watcher( |
192 | 192 | $c->getAppDataDir('preview') |
193 | 193 | ); |
194 | 194 | }); |
195 | 195 | |
196 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
196 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
197 | 197 | $view = new View(); |
198 | 198 | $util = new Encryption\Util( |
199 | 199 | $view, |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | ); |
212 | 212 | }); |
213 | 213 | |
214 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
214 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
215 | 215 | $util = new Encryption\Util( |
216 | 216 | new View(), |
217 | 217 | $c->getUserManager(), |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | ); |
226 | 226 | }); |
227 | 227 | |
228 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
228 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
229 | 229 | $view = new View(); |
230 | 230 | $util = new Encryption\Util( |
231 | 231 | $view, |
@@ -236,30 +236,30 @@ discard block |
||
236 | 236 | |
237 | 237 | return new Encryption\Keys\Storage($view, $util); |
238 | 238 | }); |
239 | - $this->registerService('TagMapper', function (Server $c) { |
|
239 | + $this->registerService('TagMapper', function(Server $c) { |
|
240 | 240 | return new TagMapper($c->getDatabaseConnection()); |
241 | 241 | }); |
242 | 242 | |
243 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
243 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
244 | 244 | $tagMapper = $c->query('TagMapper'); |
245 | 245 | return new TagManager($tagMapper, $c->getUserSession()); |
246 | 246 | }); |
247 | 247 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
248 | 248 | |
249 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
249 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
250 | 250 | $config = $c->getConfig(); |
251 | 251 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
252 | 252 | return new $factoryClass($this); |
253 | 253 | }); |
254 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
254 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
255 | 255 | return $c->query('SystemTagManagerFactory')->getManager(); |
256 | 256 | }); |
257 | 257 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
258 | 258 | |
259 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
259 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
260 | 260 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
261 | 261 | }); |
262 | - $this->registerService('RootFolder', function (Server $c) { |
|
262 | + $this->registerService('RootFolder', function(Server $c) { |
|
263 | 263 | $manager = \OC\Files\Filesystem::getMountManager(null); |
264 | 264 | $view = new View(); |
265 | 265 | $root = new Root( |
@@ -280,38 +280,38 @@ discard block |
||
280 | 280 | }); |
281 | 281 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
282 | 282 | |
283 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
284 | - return new LazyRoot(function () use ($c) { |
|
283 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
284 | + return new LazyRoot(function() use ($c) { |
|
285 | 285 | return $c->query('RootFolder'); |
286 | 286 | }); |
287 | 287 | }); |
288 | 288 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
289 | 289 | |
290 | - $this->registerService(\OC\User\Manager::class, function (Server $c) { |
|
290 | + $this->registerService(\OC\User\Manager::class, function(Server $c) { |
|
291 | 291 | $config = $c->getConfig(); |
292 | 292 | return new \OC\User\Manager($config); |
293 | 293 | }); |
294 | 294 | $this->registerAlias('UserManager', \OC\User\Manager::class); |
295 | 295 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
296 | 296 | |
297 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
297 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
298 | 298 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
299 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
299 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
300 | 300 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
301 | 301 | }); |
302 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
302 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
303 | 303 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
304 | 304 | }); |
305 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
305 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
306 | 306 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
307 | 307 | }); |
308 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
308 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
309 | 309 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
310 | 310 | }); |
311 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
311 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
312 | 312 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
313 | 313 | }); |
314 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
314 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
315 | 315 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
316 | 316 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
317 | 317 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | }); |
321 | 321 | $this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
322 | 322 | |
323 | - $this->registerService(Store::class, function (Server $c) { |
|
323 | + $this->registerService(Store::class, function(Server $c) { |
|
324 | 324 | $session = $c->getSession(); |
325 | 325 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
326 | 326 | $tokenProvider = $c->query(IProvider::class); |
@@ -331,11 +331,11 @@ discard block |
||
331 | 331 | return new Store($session, $logger, $tokenProvider); |
332 | 332 | }); |
333 | 333 | $this->registerAlias(IStore::class, Store::class); |
334 | - $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
334 | + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
335 | 335 | $dbConnection = $c->getDatabaseConnection(); |
336 | 336 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
337 | 337 | }); |
338 | - $this->registerService(Authentication\Token\DefaultTokenProvider::class, function (Server $c) { |
|
338 | + $this->registerService(Authentication\Token\DefaultTokenProvider::class, function(Server $c) { |
|
339 | 339 | $mapper = $c->query(Authentication\Token\DefaultTokenMapper::class); |
340 | 340 | $crypto = $c->getCrypto(); |
341 | 341 | $config = $c->getConfig(); |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | }); |
346 | 346 | $this->registerAlias(IProvider::class, Authentication\Token\DefaultTokenProvider::class); |
347 | 347 | |
348 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
348 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
349 | 349 | $manager = $c->getUserManager(); |
350 | 350 | $session = new \OC\Session\Memory(''); |
351 | 351 | $timeFactory = new TimeFactory(); |
@@ -369,45 +369,45 @@ discard block |
||
369 | 369 | $c->getLockdownManager(), |
370 | 370 | $c->getLogger() |
371 | 371 | ); |
372 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
372 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
373 | 373 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
374 | 374 | }); |
375 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
375 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
376 | 376 | /** @var $user \OC\User\User */ |
377 | 377 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
378 | 378 | }); |
379 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
379 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
380 | 380 | /** @var $user \OC\User\User */ |
381 | 381 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
382 | 382 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
383 | 383 | }); |
384 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
384 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
385 | 385 | /** @var $user \OC\User\User */ |
386 | 386 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
387 | 387 | }); |
388 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
388 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
389 | 389 | /** @var $user \OC\User\User */ |
390 | 390 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
391 | 391 | }); |
392 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
392 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
393 | 393 | /** @var $user \OC\User\User */ |
394 | 394 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
395 | 395 | }); |
396 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
396 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
397 | 397 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
398 | 398 | }); |
399 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
399 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
400 | 400 | /** @var $user \OC\User\User */ |
401 | 401 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
402 | 402 | }); |
403 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
403 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
404 | 404 | /** @var $user \OC\User\User */ |
405 | 405 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
406 | 406 | }); |
407 | - $userSession->listen('\OC\User', 'logout', function () { |
|
407 | + $userSession->listen('\OC\User', 'logout', function() { |
|
408 | 408 | \OC_Hook::emit('OC_User', 'logout', array()); |
409 | 409 | }); |
410 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
410 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
411 | 411 | /** @var $user \OC\User\User */ |
412 | 412 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
413 | 413 | $dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value])); |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | }); |
417 | 417 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
418 | 418 | |
419 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
419 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
420 | 420 | return new \OC\Authentication\TwoFactorAuth\Manager( |
421 | 421 | $c->getAppManager(), |
422 | 422 | $c->getSession(), |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
433 | 433 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
434 | 434 | |
435 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
435 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
436 | 436 | return new \OC\AllConfig( |
437 | 437 | $c->getSystemConfig() |
438 | 438 | ); |
@@ -440,17 +440,17 @@ discard block |
||
440 | 440 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
441 | 441 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
442 | 442 | |
443 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
443 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
444 | 444 | return new \OC\SystemConfig($config); |
445 | 445 | }); |
446 | 446 | |
447 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
447 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
448 | 448 | return new \OC\AppConfig($c->getDatabaseConnection()); |
449 | 449 | }); |
450 | 450 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
451 | 451 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
452 | 452 | |
453 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
453 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
454 | 454 | return new \OC\L10N\Factory( |
455 | 455 | $c->getConfig(), |
456 | 456 | $c->getRequest(), |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | }); |
461 | 461 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
462 | 462 | |
463 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
463 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
464 | 464 | $config = $c->getConfig(); |
465 | 465 | $cacheFactory = $c->getMemCacheFactory(); |
466 | 466 | $request = $c->getRequest(); |
@@ -475,12 +475,12 @@ discard block |
||
475 | 475 | $this->registerAlias('AppFetcher', AppFetcher::class); |
476 | 476 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
477 | 477 | |
478 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
478 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
479 | 479 | return new Cache\File(); |
480 | 480 | }); |
481 | 481 | $this->registerAlias('UserCache', \OCP\ICache::class); |
482 | 482 | |
483 | - $this->registerService(Factory::class, function (Server $c) { |
|
483 | + $this->registerService(Factory::class, function(Server $c) { |
|
484 | 484 | |
485 | 485 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
486 | 486 | ArrayCache::class, |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | $version = implode(',', $v); |
498 | 498 | $instanceId = \OC_Util::getInstanceId(); |
499 | 499 | $path = \OC::$SERVERROOT; |
500 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
500 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
501 | 501 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
502 | 502 | $config->getSystemValue('memcache.local', null), |
503 | 503 | $config->getSystemValue('memcache.distributed', null), |
@@ -510,12 +510,12 @@ discard block |
||
510 | 510 | $this->registerAlias('MemCacheFactory', Factory::class); |
511 | 511 | $this->registerAlias(ICacheFactory::class, Factory::class); |
512 | 512 | |
513 | - $this->registerService('RedisFactory', function (Server $c) { |
|
513 | + $this->registerService('RedisFactory', function(Server $c) { |
|
514 | 514 | $systemConfig = $c->getSystemConfig(); |
515 | 515 | return new RedisFactory($systemConfig); |
516 | 516 | }); |
517 | 517 | |
518 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
518 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
519 | 519 | return new \OC\Activity\Manager( |
520 | 520 | $c->getRequest(), |
521 | 521 | $c->getUserSession(), |
@@ -525,14 +525,14 @@ discard block |
||
525 | 525 | }); |
526 | 526 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
527 | 527 | |
528 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
528 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
529 | 529 | return new \OC\Activity\EventMerger( |
530 | 530 | $c->getL10N('lib') |
531 | 531 | ); |
532 | 532 | }); |
533 | 533 | $this->registerAlias(IValidator::class, Validator::class); |
534 | 534 | |
535 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
535 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
536 | 536 | return new AvatarManager( |
537 | 537 | $c->query(\OC\User\Manager::class), |
538 | 538 | $c->getAppDataDir('avatar'), |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | |
546 | 546 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
547 | 547 | |
548 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
548 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
549 | 549 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
550 | 550 | $factory = new LogFactory($c); |
551 | 551 | $logger = $factory->get($logType); |
@@ -556,12 +556,12 @@ discard block |
||
556 | 556 | }); |
557 | 557 | $this->registerAlias('Logger', \OCP\ILogger::class); |
558 | 558 | |
559 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
559 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
560 | 560 | return new LogFactory($c); |
561 | 561 | }); |
562 | 562 | $this->registerAlias('LogFactory', ILogFactory::class); |
563 | 563 | |
564 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
564 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
565 | 565 | $config = $c->getConfig(); |
566 | 566 | return new \OC\BackgroundJob\JobList( |
567 | 567 | $c->getDatabaseConnection(), |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | }); |
572 | 572 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
573 | 573 | |
574 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
574 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
575 | 575 | $cacheFactory = $c->getMemCacheFactory(); |
576 | 576 | $logger = $c->getLogger(); |
577 | 577 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -583,12 +583,12 @@ discard block |
||
583 | 583 | }); |
584 | 584 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
585 | 585 | |
586 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
586 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
587 | 587 | return new Search(); |
588 | 588 | }); |
589 | 589 | $this->registerAlias('Search', \OCP\ISearch::class); |
590 | 590 | |
591 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) { |
|
591 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) { |
|
592 | 592 | return new \OC\Security\RateLimiting\Limiter( |
593 | 593 | $this->getUserSession(), |
594 | 594 | $this->getRequest(), |
@@ -596,34 +596,34 @@ discard block |
||
596 | 596 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
597 | 597 | ); |
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), |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | $this->registerAlias('AppManager', AppManager::class); |
695 | 695 | $this->registerAlias(IAppManager::class, AppManager::class); |
696 | 696 | |
697 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
697 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
698 | 698 | return new DateTimeZone( |
699 | 699 | $c->getConfig(), |
700 | 700 | $c->getSession() |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | }); |
703 | 703 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
704 | 704 | |
705 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
705 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
706 | 706 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
707 | 707 | |
708 | 708 | return new DateTimeFormatter( |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | }); |
713 | 713 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
714 | 714 | |
715 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
715 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
716 | 716 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
717 | 717 | $listener = new UserMountCacheListener($mountCache); |
718 | 718 | $listener->listen($c->getUserManager()); |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | }); |
721 | 721 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
722 | 722 | |
723 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
723 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
724 | 724 | $loader = \OC\Files\Filesystem::getLoader(); |
725 | 725 | $mountCache = $c->query('UserMountCache'); |
726 | 726 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -736,10 +736,10 @@ discard block |
||
736 | 736 | }); |
737 | 737 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
738 | 738 | |
739 | - $this->registerService('IniWrapper', function ($c) { |
|
739 | + $this->registerService('IniWrapper', function($c) { |
|
740 | 740 | return new IniGetWrapper(); |
741 | 741 | }); |
742 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
742 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
743 | 743 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
744 | 744 | if ($busClass) { |
745 | 745 | list($app, $class) = explode('::', $busClass, 2); |
@@ -754,10 +754,10 @@ discard block |
||
754 | 754 | return new CronBus($jobList); |
755 | 755 | } |
756 | 756 | }); |
757 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
757 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
758 | 758 | return new TrustedDomainHelper($this->getConfig()); |
759 | 759 | }); |
760 | - $this->registerService('Throttler', function (Server $c) { |
|
760 | + $this->registerService('Throttler', function(Server $c) { |
|
761 | 761 | return new Throttler( |
762 | 762 | $c->getDatabaseConnection(), |
763 | 763 | new TimeFactory(), |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | $c->getConfig() |
766 | 766 | ); |
767 | 767 | }); |
768 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
768 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
769 | 769 | // IConfig and IAppManager requires a working database. This code |
770 | 770 | // might however be called when ownCloud is not yet setup. |
771 | 771 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | $c->getTempManager() |
787 | 787 | ); |
788 | 788 | }); |
789 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
789 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
790 | 790 | if (isset($this['urlParams'])) { |
791 | 791 | $urlParams = $this['urlParams']; |
792 | 792 | } else { |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | }); |
823 | 823 | $this->registerAlias('Request', \OCP\IRequest::class); |
824 | 824 | |
825 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
825 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
826 | 826 | return new Mailer( |
827 | 827 | $c->getConfig(), |
828 | 828 | $c->getLogger(), |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | }); |
834 | 834 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
835 | 835 | |
836 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
836 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
837 | 837 | $config = $c->getConfig(); |
838 | 838 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
839 | 839 | if (is_null($factoryClass)) { |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | $factory = new $factoryClass($this); |
844 | 844 | return $factory->getLDAPProvider(); |
845 | 845 | }); |
846 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
846 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
847 | 847 | $ini = $c->getIniWrapper(); |
848 | 848 | $config = $c->getConfig(); |
849 | 849 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -866,49 +866,49 @@ discard block |
||
866 | 866 | }); |
867 | 867 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
868 | 868 | |
869 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
869 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
870 | 870 | return new \OC\Files\Mount\Manager(); |
871 | 871 | }); |
872 | 872 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
873 | 873 | |
874 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
874 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
875 | 875 | return new \OC\Files\Type\Detection( |
876 | 876 | $c->getURLGenerator(), |
877 | 877 | \OC::$configDir, |
878 | - \OC::$SERVERROOT . '/resources/config/' |
|
878 | + \OC::$SERVERROOT.'/resources/config/' |
|
879 | 879 | ); |
880 | 880 | }); |
881 | 881 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
882 | 882 | |
883 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
883 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
884 | 884 | return new \OC\Files\Type\Loader( |
885 | 885 | $c->getDatabaseConnection() |
886 | 886 | ); |
887 | 887 | }); |
888 | 888 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
889 | - $this->registerService(BundleFetcher::class, function () { |
|
889 | + $this->registerService(BundleFetcher::class, function() { |
|
890 | 890 | return new BundleFetcher($this->getL10N('lib')); |
891 | 891 | }); |
892 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
892 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
893 | 893 | return new Manager( |
894 | 894 | $c->query(IValidator::class) |
895 | 895 | ); |
896 | 896 | }); |
897 | 897 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
898 | 898 | |
899 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
899 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
900 | 900 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
901 | - $manager->registerCapability(function () use ($c) { |
|
901 | + $manager->registerCapability(function() use ($c) { |
|
902 | 902 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
903 | 903 | }); |
904 | - $manager->registerCapability(function () use ($c) { |
|
904 | + $manager->registerCapability(function() use ($c) { |
|
905 | 905 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
906 | 906 | }); |
907 | 907 | return $manager; |
908 | 908 | }); |
909 | 909 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
910 | 910 | |
911 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
911 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
912 | 912 | $config = $c->getConfig(); |
913 | 913 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
914 | 914 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
919 | 919 | $manager = $c->getUserManager(); |
920 | 920 | $user = $manager->get($id); |
921 | - if(is_null($user)) { |
|
921 | + if (is_null($user)) { |
|
922 | 922 | $l = $c->getL10N('core'); |
923 | 923 | $displayName = $l->t('Unknown user'); |
924 | 924 | } else { |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | }); |
932 | 932 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
933 | 933 | |
934 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
934 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
935 | 935 | /* |
936 | 936 | * Dark magic for autoloader. |
937 | 937 | * If we do a class_exists it will try to load the class which will |
@@ -958,7 +958,7 @@ discard block |
||
958 | 958 | } |
959 | 959 | return new \OC_Defaults(); |
960 | 960 | }); |
961 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
961 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
962 | 962 | /** @var Factory $cacheFactory */ |
963 | 963 | $cacheFactory = $c->query(Factory::class); |
964 | 964 | return new SCSSCacher( |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | $this->getMemCacheFactory() |
972 | 972 | ); |
973 | 973 | }); |
974 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
974 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
975 | 975 | /** @var Factory $cacheFactory */ |
976 | 976 | $cacheFactory = $c->query(Factory::class); |
977 | 977 | return new JSCombiner( |
@@ -982,13 +982,13 @@ discard block |
||
982 | 982 | $c->getLogger() |
983 | 983 | ); |
984 | 984 | }); |
985 | - $this->registerService(EventDispatcher::class, function () { |
|
985 | + $this->registerService(EventDispatcher::class, function() { |
|
986 | 986 | return new EventDispatcher(); |
987 | 987 | }); |
988 | 988 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
989 | 989 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
990 | 990 | |
991 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
991 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
992 | 992 | // FIXME: Instantiiated here due to cyclic dependency |
993 | 993 | $request = new Request( |
994 | 994 | [ |
@@ -1013,7 +1013,7 @@ discard block |
||
1013 | 1013 | $request |
1014 | 1014 | ); |
1015 | 1015 | }); |
1016 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
1016 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
1017 | 1017 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
1018 | 1018 | |
1019 | 1019 | return new CsrfTokenManager( |
@@ -1021,22 +1021,22 @@ discard block |
||
1021 | 1021 | $c->query(SessionStorage::class) |
1022 | 1022 | ); |
1023 | 1023 | }); |
1024 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
1024 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
1025 | 1025 | return new SessionStorage($c->getSession()); |
1026 | 1026 | }); |
1027 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
1027 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
1028 | 1028 | return new ContentSecurityPolicyManager(); |
1029 | 1029 | }); |
1030 | 1030 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::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 */ |
@@ -1079,7 +1079,7 @@ discard block |
||
1079 | 1079 | |
1080 | 1080 | $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); |
1081 | 1081 | |
1082 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1082 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1083 | 1083 | $manager = new \OC\Settings\Manager( |
1084 | 1084 | $c->getLogger(), |
1085 | 1085 | $c->getDatabaseConnection(), |
@@ -1097,24 +1097,24 @@ discard block |
||
1097 | 1097 | ); |
1098 | 1098 | return $manager; |
1099 | 1099 | }); |
1100 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1100 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1101 | 1101 | return new \OC\Files\AppData\Factory( |
1102 | 1102 | $c->getRootFolder(), |
1103 | 1103 | $c->getSystemConfig() |
1104 | 1104 | ); |
1105 | 1105 | }); |
1106 | 1106 | |
1107 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1108 | - return new LockdownManager(function () use ($c) { |
|
1107 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1108 | + return new LockdownManager(function() use ($c) { |
|
1109 | 1109 | return $c->getSession(); |
1110 | 1110 | }); |
1111 | 1111 | }); |
1112 | 1112 | |
1113 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1113 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1114 | 1114 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1115 | 1115 | }); |
1116 | 1116 | |
1117 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1117 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1118 | 1118 | return new CloudIdManager(); |
1119 | 1119 | }); |
1120 | 1120 | |
@@ -1124,18 +1124,18 @@ discard block |
||
1124 | 1124 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1125 | 1125 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1126 | 1126 | |
1127 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1127 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1128 | 1128 | return new Defaults( |
1129 | 1129 | $c->getThemingDefaults() |
1130 | 1130 | ); |
1131 | 1131 | }); |
1132 | 1132 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
1133 | 1133 | |
1134 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1134 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1135 | 1135 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1136 | 1136 | }); |
1137 | 1137 | |
1138 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1138 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1139 | 1139 | return new ShareHelper( |
1140 | 1140 | $c->query(\OCP\Share\IManager::class) |
1141 | 1141 | ); |
@@ -1197,11 +1197,11 @@ discard block |
||
1197 | 1197 | // no avatar to remove |
1198 | 1198 | } catch (\Exception $e) { |
1199 | 1199 | // Ignore exceptions |
1200 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1200 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1201 | 1201 | } |
1202 | 1202 | }); |
1203 | 1203 | |
1204 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1204 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1205 | 1205 | $manager = $this->getAvatarManager(); |
1206 | 1206 | /** @var IUser $user */ |
1207 | 1207 | $user = $e->getSubject(); |
@@ -1352,7 +1352,7 @@ discard block |
||
1352 | 1352 | * @deprecated since 9.2.0 use IAppData |
1353 | 1353 | */ |
1354 | 1354 | public function getAppFolder() { |
1355 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1355 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1356 | 1356 | $root = $this->getRootFolder(); |
1357 | 1357 | if (!$root->nodeExists($dir)) { |
1358 | 1358 | $folder = $root->newFolder($dir); |
@@ -1927,7 +1927,7 @@ discard block |
||
1927 | 1927 | /** |
1928 | 1928 | * @return \OCP\Collaboration\AutoComplete\IManager |
1929 | 1929 | */ |
1930 | - public function getAutoCompleteManager(){ |
|
1930 | + public function getAutoCompleteManager() { |
|
1931 | 1931 | return $this->query(IManager::class); |
1932 | 1932 | } |
1933 | 1933 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $c = $this->getContainer()->getServer(); |
66 | 66 | |
67 | 67 | $logFile = $c->getConfig()->getAppValue('admin_audit', 'logfile', null); |
68 | - if($logFile === null) { |
|
68 | + if ($logFile === null) { |
|
69 | 69 | $this->logger = $c->getLogger(); |
70 | 70 | return; |
71 | 71 | } |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | protected function userManagementHooks() { |
101 | 101 | $userActions = new UserManagement($this->logger); |
102 | 102 | |
103 | - Util::connectHook('OC_User', 'post_createUser', $userActions, 'create'); |
|
104 | - Util::connectHook('OC_User', 'post_deleteUser', $userActions, 'delete'); |
|
105 | - Util::connectHook('OC_User', 'changeUser', $userActions, 'change'); |
|
103 | + Util::connectHook('OC_User', 'post_createUser', $userActions, 'create'); |
|
104 | + Util::connectHook('OC_User', 'post_deleteUser', $userActions, 'delete'); |
|
105 | + Util::connectHook('OC_User', 'changeUser', $userActions, 'change'); |
|
106 | 106 | |
107 | 107 | /** @var IUserSession|Session $userSession */ |
108 | 108 | $userSession = $this->getContainer()->getServer()->getUserSession(); |
@@ -111,15 +111,15 @@ discard block |
||
111 | 111 | $userSession->listen('\OC\User', 'postUnassignedUserId', [$userActions, 'unassign']); |
112 | 112 | } |
113 | 113 | |
114 | - protected function groupHooks() { |
|
114 | + protected function groupHooks() { |
|
115 | 115 | $groupActions = new GroupManagement($this->logger); |
116 | 116 | |
117 | 117 | /** @var IGroupManager|Manager $groupManager */ |
118 | 118 | $groupManager = $this->getContainer()->getServer()->getGroupManager(); |
119 | - $groupManager->listen('\OC\Group', 'postRemoveUser', [$groupActions, 'removeUser']); |
|
120 | - $groupManager->listen('\OC\Group', 'postAddUser', [$groupActions, 'addUser']); |
|
121 | - $groupManager->listen('\OC\Group', 'postDelete', [$groupActions, 'deleteGroup']); |
|
122 | - $groupManager->listen('\OC\Group', 'postCreate', [$groupActions, 'createGroup']); |
|
119 | + $groupManager->listen('\OC\Group', 'postRemoveUser', [$groupActions, 'removeUser']); |
|
120 | + $groupManager->listen('\OC\Group', 'postAddUser', [$groupActions, 'addUser']); |
|
121 | + $groupManager->listen('\OC\Group', 'postDelete', [$groupActions, 'deleteGroup']); |
|
122 | + $groupManager->listen('\OC\Group', 'postCreate', [$groupActions, 'createGroup']); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | protected function sharingHooks() { |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | protected function versionsHooks() { |
233 | 233 | $versionsActions = new Versions($this->logger); |
234 | 234 | Util::connectHook('\OCP\Versions', 'rollback', $versionsActions, 'rollback'); |
235 | - Util::connectHook('\OCP\Versions', 'delete',$versionsActions, 'delete'); |
|
235 | + Util::connectHook('\OCP\Versions', 'delete', $versionsActions, 'delete'); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | protected function trashbinHooks() { |