@@ -68,14 +68,14 @@ |
||
68 | 68 | |
69 | 69 | public function validate($config) { |
70 | 70 | $errors = []; |
71 | - if(empty($config['dbuser']) && empty($config['dbname'])) { |
|
71 | + if (empty($config['dbuser']) && empty($config['dbname'])) { |
|
72 | 72 | $errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]); |
73 | - } else if(empty($config['dbuser'])) { |
|
73 | + } else if (empty($config['dbuser'])) { |
|
74 | 74 | $errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]); |
75 | - } else if(empty($config['dbname'])) { |
|
75 | + } else if (empty($config['dbname'])) { |
|
76 | 76 | $errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]); |
77 | 77 | } |
78 | - if(substr_count($config['dbname'], '.') >= 1) { |
|
78 | + if (substr_count($config['dbname'], '.') >= 1) { |
|
79 | 79 | $errors[] = $this->trans->t("%s you may not use dots in the database name", [$this->dbprettyname]); |
80 | 80 | } |
81 | 81 | return $errors; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @param array $urlParams |
84 | 84 | * @param ServerContainer|null $server |
85 | 85 | */ |
86 | - public function __construct($appName, $urlParams = [], ServerContainer $server = null){ |
|
86 | + public function __construct($appName, $urlParams = [], ServerContainer $server = null) { |
|
87 | 87 | parent::__construct(); |
88 | 88 | $this['AppName'] = $appName; |
89 | 89 | $this['urlParams'] = $urlParams; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | /** |
106 | 106 | * Core services |
107 | 107 | */ |
108 | - $this->registerService(IOutput::class, function(){ |
|
108 | + $this->registerService(IOutput::class, function() { |
|
109 | 109 | return new Output($this->getServer()->getWebRoot()); |
110 | 110 | }); |
111 | 111 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | return $this->getServer()->getUserFolder(); |
114 | 114 | }); |
115 | 115 | |
116 | - $this->registerService(IAppData::class, function (SimpleContainer $c) { |
|
116 | + $this->registerService(IAppData::class, function(SimpleContainer $c) { |
|
117 | 117 | return $this->getServer()->getAppDataDir($c->query('AppName')); |
118 | 118 | }); |
119 | 119 | |
@@ -122,41 +122,41 @@ discard block |
||
122 | 122 | }); |
123 | 123 | |
124 | 124 | // Log wrapper |
125 | - $this->registerService(ILogger::class, function ($c) { |
|
125 | + $this->registerService(ILogger::class, function($c) { |
|
126 | 126 | return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->query('AppName')); |
127 | 127 | }); |
128 | 128 | |
129 | - $this->registerService(IServerContainer::class, function () { |
|
129 | + $this->registerService(IServerContainer::class, function() { |
|
130 | 130 | return $this->getServer(); |
131 | 131 | }); |
132 | 132 | $this->registerAlias('ServerContainer', IServerContainer::class); |
133 | 133 | |
134 | - $this->registerService(\OCP\WorkflowEngine\IManager::class, function ($c) { |
|
134 | + $this->registerService(\OCP\WorkflowEngine\IManager::class, function($c) { |
|
135 | 135 | return $c->query(Manager::class); |
136 | 136 | }); |
137 | 137 | |
138 | - $this->registerService(\OCP\AppFramework\IAppContainer::class, function ($c) { |
|
138 | + $this->registerService(\OCP\AppFramework\IAppContainer::class, function($c) { |
|
139 | 139 | return $c; |
140 | 140 | }); |
141 | 141 | |
142 | 142 | // commonly used attributes |
143 | - $this->registerService('UserId', function ($c) { |
|
143 | + $this->registerService('UserId', function($c) { |
|
144 | 144 | return $c->query(IUserSession::class)->getSession()->get('user_id'); |
145 | 145 | }); |
146 | 146 | |
147 | - $this->registerService('WebRoot', function ($c) { |
|
147 | + $this->registerService('WebRoot', function($c) { |
|
148 | 148 | return $c->query('ServerContainer')->getWebRoot(); |
149 | 149 | }); |
150 | 150 | |
151 | - $this->registerService('OC_Defaults', function ($c) { |
|
151 | + $this->registerService('OC_Defaults', function($c) { |
|
152 | 152 | return $c->getServer()->getThemingDefaults(); |
153 | 153 | }); |
154 | 154 | |
155 | - $this->registerService(IConfig::class, function ($c) { |
|
155 | + $this->registerService(IConfig::class, function($c) { |
|
156 | 156 | return $c->query(OC\GlobalScale\Config::class); |
157 | 157 | }); |
158 | 158 | |
159 | - $this->registerService('Protocol', function($c){ |
|
159 | + $this->registerService('Protocol', function($c) { |
|
160 | 160 | /** @var \OC\Server $server */ |
161 | 161 | $server = $c->query('ServerContainer'); |
162 | 162 | $protocol = $server->getRequest()->getHttpProtocol(); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * Middleware |
184 | 184 | */ |
185 | 185 | $this->registerService('MiddlewareDispatcher', function(SimpleContainer $c) { |
186 | - $server = $this->getServer(); |
|
186 | + $server = $this->getServer(); |
|
187 | 187 | |
188 | 188 | $dispatcher = new MiddlewareDispatcher(); |
189 | 189 | $dispatcher->registerMiddleware( |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $c->query(\OC\AppFramework\Middleware\AdditionalScriptsMiddleware::class) |
279 | 279 | ); |
280 | 280 | |
281 | - foreach($this->middleWares as $middleWare) { |
|
281 | + foreach ($this->middleWares as $middleWare) { |
|
282 | 282 | $dispatcher->registerMiddleware($c->query($middleWare)); |
283 | 283 | } |
284 | 284 | |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | * @return mixed |
351 | 351 | */ |
352 | 352 | public function log($message, $level) { |
353 | - switch($level){ |
|
353 | + switch ($level) { |
|
354 | 354 | case 'debug': |
355 | 355 | $level = ILogger::DEBUG; |
356 | 356 | break; |
@@ -411,12 +411,12 @@ discard block |
||
411 | 411 | return parent::query($name); |
412 | 412 | } else if ($this['AppName'] === 'core' && strpos($name, 'OC\\Core\\') === 0) { |
413 | 413 | return parent::query($name); |
414 | - } else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']) . '\\') === 0) { |
|
414 | + } else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']).'\\') === 0) { |
|
415 | 415 | return parent::query($name); |
416 | 416 | } |
417 | 417 | } |
418 | 418 | |
419 | - throw new QueryException('Could not resolve ' . $name . '!' . |
|
419 | + throw new QueryException('Could not resolve '.$name.'!'. |
|
420 | 420 | ' Class can not be instantiated', 1); |
421 | 421 | } |
422 | 422 | } |
@@ -155,19 +155,19 @@ discard block |
||
155 | 155 | if (isset($dependencies['php']['@attributes']['min-version'])) { |
156 | 156 | $minVersion = $dependencies['php']['@attributes']['min-version']; |
157 | 157 | if ($this->compareSmaller($this->platform->getPhpVersion(), $minVersion)) { |
158 | - $missing[] = (string)$this->l->t('PHP %s or higher is required.', [$minVersion]); |
|
158 | + $missing[] = (string) $this->l->t('PHP %s or higher is required.', [$minVersion]); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | if (isset($dependencies['php']['@attributes']['max-version'])) { |
162 | 162 | $maxVersion = $dependencies['php']['@attributes']['max-version']; |
163 | 163 | if ($this->compareBigger($this->platform->getPhpVersion(), $maxVersion)) { |
164 | - $missing[] = (string)$this->l->t('PHP with a version lower than %s is required.', [$maxVersion]); |
|
164 | + $missing[] = (string) $this->l->t('PHP with a version lower than %s is required.', [$maxVersion]); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | if (isset($dependencies['php']['@attributes']['min-int-size'])) { |
168 | 168 | $intSize = $dependencies['php']['@attributes']['min-int-size']; |
169 | - if ($intSize > $this->platform->getIntSize()*8) { |
|
170 | - $missing[] = (string)$this->l->t('%sbit or higher PHP required.', [$intSize]); |
|
169 | + if ($intSize > $this->platform->getIntSize() * 8) { |
|
170 | + $missing[] = (string) $this->l->t('%sbit or higher PHP required.', [$intSize]); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | return $missing; |
@@ -190,12 +190,12 @@ discard block |
||
190 | 190 | if (!is_array($supportedDatabases)) { |
191 | 191 | $supportedDatabases = [$supportedDatabases]; |
192 | 192 | } |
193 | - $supportedDatabases = array_map(function ($db) { |
|
193 | + $supportedDatabases = array_map(function($db) { |
|
194 | 194 | return $this->getValue($db); |
195 | 195 | }, $supportedDatabases); |
196 | 196 | $currentDatabase = $this->platform->getDatabase(); |
197 | 197 | if (!in_array($currentDatabase, $supportedDatabases)) { |
198 | - $missing[] = (string)$this->l->t('Following databases are supported: %s', [implode(', ', $supportedDatabases)]); |
|
198 | + $missing[] = (string) $this->l->t('Following databases are supported: %s', [implode(', ', $supportedDatabases)]); |
|
199 | 199 | } |
200 | 200 | return $missing; |
201 | 201 | } |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | } |
225 | 225 | $commandName = $this->getValue($command); |
226 | 226 | if (!$this->platform->isCommandKnown($commandName)) { |
227 | - $missing[] = (string)$this->l->t('The command line tool %s could not be found', [$commandName]); |
|
227 | + $missing[] = (string) $this->l->t('The command line tool %s could not be found', [$commandName]); |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | return $missing; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | return $missing; |
291 | 291 | } |
292 | 292 | if (is_array($oss)) { |
293 | - $oss = array_map(function ($os) { |
|
293 | + $oss = array_map(function($os) { |
|
294 | 294 | return $this->getValue($os); |
295 | 295 | }, $oss); |
296 | 296 | } else { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | } |
299 | 299 | $currentOS = $this->platform->getOS(); |
300 | 300 | if (!in_array($currentOS, $oss)) { |
301 | - $missing[] = (string)$this->l->t('Following platforms are supported: %s', [implode(', ', $oss)]); |
|
301 | + $missing[] = (string) $this->l->t('Following platforms are supported: %s', [implode(', ', $oss)]); |
|
302 | 302 | } |
303 | 303 | return $missing; |
304 | 304 | } |
@@ -324,12 +324,12 @@ discard block |
||
324 | 324 | |
325 | 325 | if (!is_null($minVersion)) { |
326 | 326 | if ($this->compareSmaller($this->platform->getOcVersion(), $minVersion)) { |
327 | - $missing[] = (string)$this->l->t('Server version %s or higher is required.', [$this->toVisibleVersion($minVersion)]); |
|
327 | + $missing[] = (string) $this->l->t('Server version %s or higher is required.', [$this->toVisibleVersion($minVersion)]); |
|
328 | 328 | } |
329 | 329 | } |
330 | 330 | if (!$ignoreMax && !is_null($maxVersion)) { |
331 | 331 | if ($this->compareBigger($this->platform->getOcVersion(), $maxVersion)) { |
332 | - $missing[] = (string)$this->l->t('Server version %s or lower is required.', [$this->toVisibleVersion($maxVersion)]); |
|
332 | + $missing[] = (string) $this->l->t('Server version %s or lower is required.', [$this->toVisibleVersion($maxVersion)]); |
|
333 | 333 | } |
334 | 334 | } |
335 | 335 | return $missing; |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | return '10'; |
362 | 362 | default: |
363 | 363 | if (strpos($version, '9.1.') === 0) { |
364 | - $version = '10.0.' . substr($version, 4); |
|
364 | + $version = '10.0.'.substr($version, 4); |
|
365 | 365 | } |
366 | 366 | return $version; |
367 | 367 | } |
@@ -375,6 +375,6 @@ discard block |
||
375 | 375 | if (isset($element['@value'])) { |
376 | 376 | return $element['@value']; |
377 | 377 | } |
378 | - return (string)$element; |
|
378 | + return (string) $element; |
|
379 | 379 | } |
380 | 380 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | // To find out if we are running from CLI or not |
252 | 252 | $this->registerParameter('isCLI', \OC::$CLI); |
253 | 253 | |
254 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
254 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
255 | 255 | return $c; |
256 | 256 | }); |
257 | 257 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
273 | 273 | |
274 | 274 | |
275 | - $this->registerService(IPreview::class, function (Server $c) { |
|
275 | + $this->registerService(IPreview::class, function(Server $c) { |
|
276 | 276 | return new PreviewManager( |
277 | 277 | $c->getConfig(), |
278 | 278 | $c->getRootFolder(), |
@@ -284,13 +284,13 @@ discard block |
||
284 | 284 | }); |
285 | 285 | $this->registerDeprecatedAlias('PreviewManager', IPreview::class); |
286 | 286 | |
287 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
287 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
288 | 288 | return new \OC\Preview\Watcher( |
289 | 289 | $c->getAppDataDir('preview') |
290 | 290 | ); |
291 | 291 | }); |
292 | 292 | |
293 | - $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
293 | + $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
|
294 | 294 | $view = new View(); |
295 | 295 | $util = new Encryption\Util( |
296 | 296 | $view, |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | }); |
310 | 310 | $this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
311 | 311 | |
312 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
312 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
313 | 313 | $util = new Encryption\Util( |
314 | 314 | new View(), |
315 | 315 | $c->getUserManager(), |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | ); |
324 | 324 | }); |
325 | 325 | |
326 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
326 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
327 | 327 | $view = new View(); |
328 | 328 | $util = new Encryption\Util( |
329 | 329 | $view, |
@@ -334,30 +334,30 @@ discard block |
||
334 | 334 | |
335 | 335 | return new Encryption\Keys\Storage($view, $util); |
336 | 336 | }); |
337 | - $this->registerService('TagMapper', function (Server $c) { |
|
337 | + $this->registerService('TagMapper', function(Server $c) { |
|
338 | 338 | return new TagMapper($c->getDatabaseConnection()); |
339 | 339 | }); |
340 | 340 | |
341 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
341 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
342 | 342 | $tagMapper = $c->query('TagMapper'); |
343 | 343 | return new TagManager($tagMapper, $c->getUserSession()); |
344 | 344 | }); |
345 | 345 | $this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class); |
346 | 346 | |
347 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
347 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
348 | 348 | $config = $c->getConfig(); |
349 | 349 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
350 | 350 | return new $factoryClass($this); |
351 | 351 | }); |
352 | - $this->registerService(ISystemTagManager::class, function (Server $c) { |
|
352 | + $this->registerService(ISystemTagManager::class, function(Server $c) { |
|
353 | 353 | return $c->query('SystemTagManagerFactory')->getManager(); |
354 | 354 | }); |
355 | 355 | $this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class); |
356 | 356 | |
357 | - $this->registerService(ISystemTagObjectMapper::class, function (Server $c) { |
|
357 | + $this->registerService(ISystemTagObjectMapper::class, function(Server $c) { |
|
358 | 358 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
359 | 359 | }); |
360 | - $this->registerService('RootFolder', function (Server $c) { |
|
360 | + $this->registerService('RootFolder', function(Server $c) { |
|
361 | 361 | $manager = \OC\Files\Filesystem::getMountManager(null); |
362 | 362 | $view = new View(); |
363 | 363 | $root = new Root( |
@@ -378,8 +378,8 @@ discard block |
||
378 | 378 | }); |
379 | 379 | $this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class); |
380 | 380 | |
381 | - $this->registerService(IRootFolder::class, function (Server $c) { |
|
382 | - return new LazyRoot(function () use ($c) { |
|
381 | + $this->registerService(IRootFolder::class, function(Server $c) { |
|
382 | + return new LazyRoot(function() use ($c) { |
|
383 | 383 | return $c->query('RootFolder'); |
384 | 384 | }); |
385 | 385 | }); |
@@ -388,44 +388,44 @@ discard block |
||
388 | 388 | $this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class); |
389 | 389 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
390 | 390 | |
391 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
391 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
392 | 392 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger()); |
393 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
393 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
394 | 394 | \OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]); |
395 | 395 | |
396 | 396 | /** @var IEventDispatcher $dispatcher */ |
397 | 397 | $dispatcher = $this->query(IEventDispatcher::class); |
398 | 398 | $dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); |
399 | 399 | }); |
400 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) { |
|
400 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) { |
|
401 | 401 | \OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]); |
402 | 402 | |
403 | 403 | /** @var IEventDispatcher $dispatcher */ |
404 | 404 | $dispatcher = $this->query(IEventDispatcher::class); |
405 | 405 | $dispatcher->dispatchTyped(new GroupCreatedEvent($group)); |
406 | 406 | }); |
407 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
407 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
408 | 408 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]); |
409 | 409 | |
410 | 410 | /** @var IEventDispatcher $dispatcher */ |
411 | 411 | $dispatcher = $this->query(IEventDispatcher::class); |
412 | 412 | $dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group)); |
413 | 413 | }); |
414 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
414 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
415 | 415 | \OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]); |
416 | 416 | |
417 | 417 | /** @var IEventDispatcher $dispatcher */ |
418 | 418 | $dispatcher = $this->query(IEventDispatcher::class); |
419 | 419 | $dispatcher->dispatchTyped(new GroupDeletedEvent($group)); |
420 | 420 | }); |
421 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
421 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
422 | 422 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]); |
423 | 423 | |
424 | 424 | /** @var IEventDispatcher $dispatcher */ |
425 | 425 | $dispatcher = $this->query(IEventDispatcher::class); |
426 | 426 | $dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user)); |
427 | 427 | }); |
428 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
428 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
429 | 429 | \OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]); |
430 | 430 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
431 | 431 | \OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]); |
@@ -434,12 +434,12 @@ discard block |
||
434 | 434 | $dispatcher = $this->query(IEventDispatcher::class); |
435 | 435 | $dispatcher->dispatchTyped(new UserAddedEvent($group, $user)); |
436 | 436 | }); |
437 | - $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
437 | + $groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
438 | 438 | /** @var IEventDispatcher $dispatcher */ |
439 | 439 | $dispatcher = $this->query(IEventDispatcher::class); |
440 | 440 | $dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user)); |
441 | 441 | }); |
442 | - $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
442 | + $groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
443 | 443 | /** @var IEventDispatcher $dispatcher */ |
444 | 444 | $dispatcher = $this->query(IEventDispatcher::class); |
445 | 445 | $dispatcher->dispatchTyped(new UserRemovedEvent($group, $user)); |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | }); |
449 | 449 | $this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class); |
450 | 450 | |
451 | - $this->registerService(Store::class, function (Server $c) { |
|
451 | + $this->registerService(Store::class, function(Server $c) { |
|
452 | 452 | $session = $c->getSession(); |
453 | 453 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
454 | 454 | $tokenProvider = $c->query(IProvider::class); |
@@ -459,13 +459,13 @@ discard block |
||
459 | 459 | return new Store($session, $logger, $tokenProvider); |
460 | 460 | }); |
461 | 461 | $this->registerAlias(IStore::class, Store::class); |
462 | - $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
462 | + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
463 | 463 | $dbConnection = $c->getDatabaseConnection(); |
464 | 464 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
465 | 465 | }); |
466 | 466 | $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
467 | 467 | |
468 | - $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
468 | + $this->registerService(\OC\User\Session::class, function(Server $c) { |
|
469 | 469 | $manager = $c->getUserManager(); |
470 | 470 | $session = new \OC\Session\Memory(''); |
471 | 471 | $timeFactory = new TimeFactory(); |
@@ -490,14 +490,14 @@ discard block |
||
490 | 490 | $c->getLogger(), |
491 | 491 | $c->query(IEventDispatcher::class) |
492 | 492 | ); |
493 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
493 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
494 | 494 | \OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]); |
495 | 495 | |
496 | 496 | /** @var IEventDispatcher $dispatcher */ |
497 | 497 | $dispatcher = $this->query(IEventDispatcher::class); |
498 | 498 | $dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password)); |
499 | 499 | }); |
500 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
500 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
501 | 501 | /** @var $user \OC\User\User */ |
502 | 502 | \OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]); |
503 | 503 | |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | $dispatcher = $this->query(IEventDispatcher::class); |
506 | 506 | $dispatcher->dispatchTyped(new UserCreatedEvent($user, $password)); |
507 | 507 | }); |
508 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) { |
|
508 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) { |
|
509 | 509 | /** @var $user \OC\User\User */ |
510 | 510 | \OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]); |
511 | 511 | $legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | $dispatcher = $this->query(IEventDispatcher::class); |
515 | 515 | $dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user)); |
516 | 516 | }); |
517 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
517 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
518 | 518 | /** @var $user \OC\User\User */ |
519 | 519 | \OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]); |
520 | 520 | |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | $dispatcher = $this->query(IEventDispatcher::class); |
523 | 523 | $dispatcher->dispatchTyped(new UserDeletedEvent($user)); |
524 | 524 | }); |
525 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
525 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
526 | 526 | /** @var $user \OC\User\User */ |
527 | 527 | \OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
528 | 528 | |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | $dispatcher = $this->query(IEventDispatcher::class); |
531 | 531 | $dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword)); |
532 | 532 | }); |
533 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
533 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
534 | 534 | /** @var $user \OC\User\User */ |
535 | 535 | \OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
536 | 536 | |
@@ -538,14 +538,14 @@ discard block |
||
538 | 538 | $dispatcher = $this->query(IEventDispatcher::class); |
539 | 539 | $dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword)); |
540 | 540 | }); |
541 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
541 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
542 | 542 | \OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]); |
543 | 543 | |
544 | 544 | /** @var IEventDispatcher $dispatcher */ |
545 | 545 | $dispatcher = $this->query(IEventDispatcher::class); |
546 | 546 | $dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password)); |
547 | 547 | }); |
548 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) { |
|
548 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) { |
|
549 | 549 | /** @var $user \OC\User\User */ |
550 | 550 | \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin]); |
551 | 551 | |
@@ -553,12 +553,12 @@ discard block |
||
553 | 553 | $dispatcher = $this->query(IEventDispatcher::class); |
554 | 554 | $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin)); |
555 | 555 | }); |
556 | - $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { |
|
556 | + $userSession->listen('\OC\User', 'preRememberedLogin', function($uid) { |
|
557 | 557 | /** @var IEventDispatcher $dispatcher */ |
558 | 558 | $dispatcher = $this->query(IEventDispatcher::class); |
559 | 559 | $dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); |
560 | 560 | }); |
561 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
561 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
562 | 562 | /** @var $user \OC\User\User */ |
563 | 563 | \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]); |
564 | 564 | |
@@ -566,19 +566,19 @@ discard block |
||
566 | 566 | $dispatcher = $this->query(IEventDispatcher::class); |
567 | 567 | $dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password)); |
568 | 568 | }); |
569 | - $userSession->listen('\OC\User', 'logout', function ($user) { |
|
569 | + $userSession->listen('\OC\User', 'logout', function($user) { |
|
570 | 570 | \OC_Hook::emit('OC_User', 'logout', []); |
571 | 571 | |
572 | 572 | /** @var IEventDispatcher $dispatcher */ |
573 | 573 | $dispatcher = $this->query(IEventDispatcher::class); |
574 | 574 | $dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user)); |
575 | 575 | }); |
576 | - $userSession->listen('\OC\User', 'postLogout', function ($user) { |
|
576 | + $userSession->listen('\OC\User', 'postLogout', function($user) { |
|
577 | 577 | /** @var IEventDispatcher $dispatcher */ |
578 | 578 | $dispatcher = $this->query(IEventDispatcher::class); |
579 | 579 | $dispatcher->dispatchTyped(new UserLoggedOutEvent($user)); |
580 | 580 | }); |
581 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
581 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
582 | 582 | /** @var $user \OC\User\User */ |
583 | 583 | \OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]); |
584 | 584 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $this->registerAlias(INavigationManager::class, \OC\NavigationManager::class); |
597 | 597 | $this->registerDeprecatedAlias('NavigationManager', INavigationManager::class); |
598 | 598 | |
599 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
599 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
600 | 600 | return new \OC\AllConfig( |
601 | 601 | $c->getSystemConfig() |
602 | 602 | ); |
@@ -604,18 +604,18 @@ discard block |
||
604 | 604 | $this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class); |
605 | 605 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
606 | 606 | |
607 | - $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
|
607 | + $this->registerService(\OC\SystemConfig::class, function($c) use ($config) { |
|
608 | 608 | return new \OC\SystemConfig($config); |
609 | 609 | }); |
610 | 610 | $this->registerDeprecatedAlias('SystemConfig', \OC\SystemConfig::class); |
611 | 611 | |
612 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
612 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
613 | 613 | return new \OC\AppConfig($c->getDatabaseConnection()); |
614 | 614 | }); |
615 | 615 | $this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class); |
616 | 616 | $this->registerAlias(IAppConfig::class, \OC\AppConfig::class); |
617 | 617 | |
618 | - $this->registerService(IFactory::class, function (Server $c) { |
|
618 | + $this->registerService(IFactory::class, function(Server $c) { |
|
619 | 619 | return new \OC\L10N\Factory( |
620 | 620 | $c->getConfig(), |
621 | 621 | $c->getRequest(), |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | }); |
626 | 626 | $this->registerDeprecatedAlias('L10NFactory', IFactory::class); |
627 | 627 | |
628 | - $this->registerService(IURLGenerator::class, function (Server $c) { |
|
628 | + $this->registerService(IURLGenerator::class, function(Server $c) { |
|
629 | 629 | $config = $c->getConfig(); |
630 | 630 | $cacheFactory = $c->getMemCacheFactory(); |
631 | 631 | $request = $c->getRequest(); |
@@ -640,12 +640,12 @@ discard block |
||
640 | 640 | $this->registerDeprecatedAlias('AppFetcher', AppFetcher::class); |
641 | 641 | $this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class); |
642 | 642 | |
643 | - $this->registerService(ICache::class, function ($c) { |
|
643 | + $this->registerService(ICache::class, function($c) { |
|
644 | 644 | return new Cache\File(); |
645 | 645 | }); |
646 | 646 | $this->registerDeprecatedAlias('UserCache', ICache::class); |
647 | 647 | |
648 | - $this->registerService(Factory::class, function (Server $c) { |
|
648 | + $this->registerService(Factory::class, function(Server $c) { |
|
649 | 649 | |
650 | 650 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
651 | 651 | ArrayCache::class, |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | $version = implode(',', $v); |
661 | 661 | $instanceId = \OC_Util::getInstanceId(); |
662 | 662 | $path = \OC::$SERVERROOT; |
663 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
663 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
664 | 664 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
665 | 665 | $config->getSystemValue('memcache.local', null), |
666 | 666 | $config->getSystemValue('memcache.distributed', null), |
@@ -673,12 +673,12 @@ discard block |
||
673 | 673 | $this->registerDeprecatedAlias('MemCacheFactory', Factory::class); |
674 | 674 | $this->registerAlias(ICacheFactory::class, Factory::class); |
675 | 675 | |
676 | - $this->registerService('RedisFactory', function (Server $c) { |
|
676 | + $this->registerService('RedisFactory', function(Server $c) { |
|
677 | 677 | $systemConfig = $c->getSystemConfig(); |
678 | 678 | return new RedisFactory($systemConfig); |
679 | 679 | }); |
680 | 680 | |
681 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
681 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
682 | 682 | return new \OC\Activity\Manager( |
683 | 683 | $c->getRequest(), |
684 | 684 | $c->getUserSession(), |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | }); |
689 | 689 | $this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class); |
690 | 690 | |
691 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
691 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
692 | 692 | return new \OC\Activity\EventMerger( |
693 | 693 | $c->getL10N('lib') |
694 | 694 | ); |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
711 | 711 | $this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
712 | 712 | |
713 | - $this->registerService(\OC\Log::class, function (Server $c) { |
|
713 | + $this->registerService(\OC\Log::class, function(Server $c) { |
|
714 | 714 | $logType = $c->query(AllConfig::class)->getSystemValue('log_type', 'file'); |
715 | 715 | $factory = new LogFactory($c, $this->getSystemConfig()); |
716 | 716 | $logger = $factory->get($logType); |
@@ -721,11 +721,11 @@ discard block |
||
721 | 721 | $this->registerAlias(ILogger::class, \OC\Log::class); |
722 | 722 | $this->registerDeprecatedAlias('Logger', \OC\Log::class); |
723 | 723 | |
724 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
724 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
725 | 725 | return new LogFactory($c, $this->getSystemConfig()); |
726 | 726 | }); |
727 | 727 | |
728 | - $this->registerService(IJobList::class, function (Server $c) { |
|
728 | + $this->registerService(IJobList::class, function(Server $c) { |
|
729 | 729 | $config = $c->getConfig(); |
730 | 730 | return new \OC\BackgroundJob\JobList( |
731 | 731 | $c->getDatabaseConnection(), |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | }); |
736 | 736 | $this->registerDeprecatedAlias('JobList', IJobList::class); |
737 | 737 | |
738 | - $this->registerService(IRouter::class, function (Server $c) { |
|
738 | + $this->registerService(IRouter::class, function(Server $c) { |
|
739 | 739 | $cacheFactory = $c->getMemCacheFactory(); |
740 | 740 | $logger = $c->getLogger(); |
741 | 741 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -747,39 +747,39 @@ discard block |
||
747 | 747 | }); |
748 | 748 | $this->registerDeprecatedAlias('Router', IRouter::class); |
749 | 749 | |
750 | - $this->registerService(ISearch::class, function ($c) { |
|
750 | + $this->registerService(ISearch::class, function($c) { |
|
751 | 751 | return new Search(); |
752 | 752 | }); |
753 | 753 | $this->registerDeprecatedAlias('Search', ISearch::class); |
754 | 754 | |
755 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
755 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
756 | 756 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
757 | 757 | $this->getMemCacheFactory(), |
758 | 758 | new \OC\AppFramework\Utility\TimeFactory() |
759 | 759 | ); |
760 | 760 | }); |
761 | 761 | |
762 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
762 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
763 | 763 | return new SecureRandom(); |
764 | 764 | }); |
765 | 765 | $this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
766 | 766 | |
767 | - $this->registerService(ICrypto::class, function (Server $c) { |
|
767 | + $this->registerService(ICrypto::class, function(Server $c) { |
|
768 | 768 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
769 | 769 | }); |
770 | 770 | $this->registerDeprecatedAlias('Crypto', ICrypto::class); |
771 | 771 | |
772 | - $this->registerService(IHasher::class, function (Server $c) { |
|
772 | + $this->registerService(IHasher::class, function(Server $c) { |
|
773 | 773 | return new Hasher($c->getConfig()); |
774 | 774 | }); |
775 | 775 | $this->registerDeprecatedAlias('Hasher', IHasher::class); |
776 | 776 | |
777 | - $this->registerService(ICredentialsManager::class, function (Server $c) { |
|
777 | + $this->registerService(ICredentialsManager::class, function(Server $c) { |
|
778 | 778 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
779 | 779 | }); |
780 | 780 | $this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class); |
781 | 781 | |
782 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
782 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
783 | 783 | $systemConfig = $c->getSystemConfig(); |
784 | 784 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
785 | 785 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | $this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class); |
795 | 795 | |
796 | 796 | |
797 | - $this->registerService(IClientService::class, function (Server $c) { |
|
797 | + $this->registerService(IClientService::class, function(Server $c) { |
|
798 | 798 | $user = \OC_User::getUser(); |
799 | 799 | $uid = $user ? $user : null; |
800 | 800 | return new ClientService( |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | ); |
810 | 810 | }); |
811 | 811 | $this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
812 | - $this->registerService(IEventLogger::class, function (Server $c) { |
|
812 | + $this->registerService(IEventLogger::class, function(Server $c) { |
|
813 | 813 | $eventLogger = new EventLogger(); |
814 | 814 | if ($c->getSystemConfig()->getValue('debug', false)) { |
815 | 815 | // In debug mode, module is being activated by default |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | }); |
820 | 820 | $this->registerDeprecatedAlias('EventLogger', IEventLogger::class); |
821 | 821 | |
822 | - $this->registerService(IQueryLogger::class, function (Server $c) { |
|
822 | + $this->registerService(IQueryLogger::class, function(Server $c) { |
|
823 | 823 | $queryLogger = new QueryLogger(); |
824 | 824 | if ($c->getSystemConfig()->getValue('debug', false)) { |
825 | 825 | // In debug mode, module is being activated by default |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | }); |
830 | 830 | $this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class); |
831 | 831 | |
832 | - $this->registerService(TempManager::class, function (Server $c) { |
|
832 | + $this->registerService(TempManager::class, function(Server $c) { |
|
833 | 833 | return new TempManager( |
834 | 834 | $c->getLogger(), |
835 | 835 | $c->getConfig() |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | $this->registerDeprecatedAlias('TempManager', TempManager::class); |
839 | 839 | $this->registerAlias(ITempManager::class, TempManager::class); |
840 | 840 | |
841 | - $this->registerService(AppManager::class, function (Server $c) { |
|
841 | + $this->registerService(AppManager::class, function(Server $c) { |
|
842 | 842 | return new \OC\App\AppManager( |
843 | 843 | $c->getUserSession(), |
844 | 844 | $c->getConfig(), |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | $this->registerDeprecatedAlias('AppManager', AppManager::class); |
853 | 853 | $this->registerAlias(IAppManager::class, AppManager::class); |
854 | 854 | |
855 | - $this->registerService(IDateTimeZone::class, function (Server $c) { |
|
855 | + $this->registerService(IDateTimeZone::class, function(Server $c) { |
|
856 | 856 | return new DateTimeZone( |
857 | 857 | $c->getConfig(), |
858 | 858 | $c->getSession() |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | }); |
861 | 861 | $this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class); |
862 | 862 | |
863 | - $this->registerService(IDateTimeFormatter::class, function (Server $c) { |
|
863 | + $this->registerService(IDateTimeFormatter::class, function(Server $c) { |
|
864 | 864 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
865 | 865 | |
866 | 866 | return new DateTimeFormatter( |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | }); |
871 | 871 | $this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class); |
872 | 872 | |
873 | - $this->registerService(IUserMountCache::class, function (Server $c) { |
|
873 | + $this->registerService(IUserMountCache::class, function(Server $c) { |
|
874 | 874 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
875 | 875 | $listener = new UserMountCacheListener($mountCache); |
876 | 876 | $listener->listen($c->getUserManager()); |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | }); |
879 | 879 | $this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class); |
880 | 880 | |
881 | - $this->registerService(IMountProviderCollection::class, function (Server $c) { |
|
881 | + $this->registerService(IMountProviderCollection::class, function(Server $c) { |
|
882 | 882 | $loader = \OC\Files\Filesystem::getLoader(); |
883 | 883 | $mountCache = $c->query(IUserMountCache::class); |
884 | 884 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -894,10 +894,10 @@ discard block |
||
894 | 894 | }); |
895 | 895 | $this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class); |
896 | 896 | |
897 | - $this->registerService('IniWrapper', function ($c) { |
|
897 | + $this->registerService('IniWrapper', function($c) { |
|
898 | 898 | return new IniGetWrapper(); |
899 | 899 | }); |
900 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
900 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
901 | 901 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
902 | 902 | if ($busClass) { |
903 | 903 | list($app, $class) = explode('::', $busClass, 2); |
@@ -912,10 +912,10 @@ discard block |
||
912 | 912 | return new CronBus($jobList); |
913 | 913 | } |
914 | 914 | }); |
915 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
915 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
916 | 916 | return new TrustedDomainHelper($this->getConfig()); |
917 | 917 | }); |
918 | - $this->registerService(Throttler::class, function (Server $c) { |
|
918 | + $this->registerService(Throttler::class, function(Server $c) { |
|
919 | 919 | return new Throttler( |
920 | 920 | $c->getDatabaseConnection(), |
921 | 921 | new TimeFactory(), |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | ); |
925 | 925 | }); |
926 | 926 | $this->registerDeprecatedAlias('Throttler', Throttler::class); |
927 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
927 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
928 | 928 | // IConfig and IAppManager requires a working database. This code |
929 | 929 | // might however be called when ownCloud is not yet setup. |
930 | 930 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | $c->getMimeTypeDetector() |
947 | 947 | ); |
948 | 948 | }); |
949 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
949 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
950 | 950 | if (isset($this['urlParams'])) { |
951 | 951 | $urlParams = $this['urlParams']; |
952 | 952 | } else { |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | }); |
983 | 983 | $this->registerDeprecatedAlias('Request', \OCP\IRequest::class); |
984 | 984 | |
985 | - $this->registerService(IMailer::class, function (Server $c) { |
|
985 | + $this->registerService(IMailer::class, function(Server $c) { |
|
986 | 986 | return new Mailer( |
987 | 987 | $c->getConfig(), |
988 | 988 | $c->getLogger(), |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | }); |
995 | 995 | $this->registerDeprecatedAlias('Mailer', IMailer::class); |
996 | 996 | |
997 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
997 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
998 | 998 | $config = $c->getConfig(); |
999 | 999 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
1000 | 1000 | if (is_null($factoryClass)) { |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | $factory = new $factoryClass($this); |
1005 | 1005 | return $factory->getLDAPProvider(); |
1006 | 1006 | }); |
1007 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
1007 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
1008 | 1008 | $ini = $c->getIniWrapper(); |
1009 | 1009 | $config = $c->getConfig(); |
1010 | 1010 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -1027,31 +1027,31 @@ discard block |
||
1027 | 1027 | }); |
1028 | 1028 | $this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class); |
1029 | 1029 | |
1030 | - $this->registerService(IMountManager::class, function () { |
|
1030 | + $this->registerService(IMountManager::class, function() { |
|
1031 | 1031 | return new \OC\Files\Mount\Manager(); |
1032 | 1032 | }); |
1033 | 1033 | $this->registerDeprecatedAlias('MountManager', IMountManager::class); |
1034 | 1034 | |
1035 | - $this->registerService(IMimeTypeDetector::class, function (Server $c) { |
|
1035 | + $this->registerService(IMimeTypeDetector::class, function(Server $c) { |
|
1036 | 1036 | return new \OC\Files\Type\Detection( |
1037 | 1037 | $c->getURLGenerator(), |
1038 | 1038 | $c->getLogger(), |
1039 | 1039 | \OC::$configDir, |
1040 | - \OC::$SERVERROOT . '/resources/config/' |
|
1040 | + \OC::$SERVERROOT.'/resources/config/' |
|
1041 | 1041 | ); |
1042 | 1042 | }); |
1043 | 1043 | $this->registerDeprecatedAlias('MimeTypeDetector', IMimeTypeDetector::class); |
1044 | 1044 | |
1045 | - $this->registerService(IMimeTypeLoader::class, function (Server $c) { |
|
1045 | + $this->registerService(IMimeTypeLoader::class, function(Server $c) { |
|
1046 | 1046 | return new \OC\Files\Type\Loader( |
1047 | 1047 | $c->getDatabaseConnection() |
1048 | 1048 | ); |
1049 | 1049 | }); |
1050 | 1050 | $this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class); |
1051 | - $this->registerService(BundleFetcher::class, function () { |
|
1051 | + $this->registerService(BundleFetcher::class, function() { |
|
1052 | 1052 | return new BundleFetcher($this->getL10N('lib')); |
1053 | 1053 | }); |
1054 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
1054 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
1055 | 1055 | return new Manager( |
1056 | 1056 | $c->query(IValidator::class), |
1057 | 1057 | $c->getLogger() |
@@ -1059,19 +1059,19 @@ discard block |
||
1059 | 1059 | }); |
1060 | 1060 | $this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class); |
1061 | 1061 | |
1062 | - $this->registerService(CapabilitiesManager::class, function (Server $c) { |
|
1062 | + $this->registerService(CapabilitiesManager::class, function(Server $c) { |
|
1063 | 1063 | $manager = new CapabilitiesManager($c->getLogger()); |
1064 | - $manager->registerCapability(function () use ($c) { |
|
1064 | + $manager->registerCapability(function() use ($c) { |
|
1065 | 1065 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
1066 | 1066 | }); |
1067 | - $manager->registerCapability(function () use ($c) { |
|
1067 | + $manager->registerCapability(function() use ($c) { |
|
1068 | 1068 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
1069 | 1069 | }); |
1070 | 1070 | return $manager; |
1071 | 1071 | }); |
1072 | 1072 | $this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class); |
1073 | 1073 | |
1074 | - $this->registerService(ICommentsManager::class, function (Server $c) { |
|
1074 | + $this->registerService(ICommentsManager::class, function(Server $c) { |
|
1075 | 1075 | $config = $c->getConfig(); |
1076 | 1076 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
1077 | 1077 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -1081,7 +1081,7 @@ discard block |
||
1081 | 1081 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
1082 | 1082 | $manager = $c->getUserManager(); |
1083 | 1083 | $user = $manager->get($id); |
1084 | - if(is_null($user)) { |
|
1084 | + if (is_null($user)) { |
|
1085 | 1085 | $l = $c->getL10N('core'); |
1086 | 1086 | $displayName = $l->t('Unknown user'); |
1087 | 1087 | } else { |
@@ -1094,7 +1094,7 @@ discard block |
||
1094 | 1094 | }); |
1095 | 1095 | $this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class); |
1096 | 1096 | |
1097 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
1097 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
1098 | 1098 | /* |
1099 | 1099 | * Dark magic for autoloader. |
1100 | 1100 | * If we do a class_exists it will try to load the class which will |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | } |
1123 | 1123 | return new \OC_Defaults(); |
1124 | 1124 | }); |
1125 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
1125 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
1126 | 1126 | return new SCSSCacher( |
1127 | 1127 | $c->getLogger(), |
1128 | 1128 | $c->query(\OC\Files\AppData\Factory::class), |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | new TimeFactory() |
1136 | 1136 | ); |
1137 | 1137 | }); |
1138 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
1138 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
1139 | 1139 | return new JSCombiner( |
1140 | 1140 | $c->getAppDataDir('js'), |
1141 | 1141 | $c->getURLGenerator(), |
@@ -1148,7 +1148,7 @@ discard block |
||
1148 | 1148 | $this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
1149 | 1149 | $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
1150 | 1150 | |
1151 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
1151 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
1152 | 1152 | // FIXME: Instantiiated here due to cyclic dependency |
1153 | 1153 | $request = new Request( |
1154 | 1154 | [ |
@@ -1173,7 +1173,7 @@ discard block |
||
1173 | 1173 | $request |
1174 | 1174 | ); |
1175 | 1175 | }); |
1176 | - $this->registerService(CsrfTokenManager::class, function (Server $c) { |
|
1176 | + $this->registerService(CsrfTokenManager::class, function(Server $c) { |
|
1177 | 1177 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
1178 | 1178 | |
1179 | 1179 | return new CsrfTokenManager( |
@@ -1182,20 +1182,20 @@ discard block |
||
1182 | 1182 | ); |
1183 | 1183 | }); |
1184 | 1184 | $this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class); |
1185 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
1185 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
1186 | 1186 | return new SessionStorage($c->getSession()); |
1187 | 1187 | }); |
1188 | 1188 | $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class); |
1189 | 1189 | $this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class); |
1190 | 1190 | |
1191 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
1191 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
1192 | 1192 | return new ContentSecurityPolicyNonceManager( |
1193 | 1193 | $c->getCsrfTokenManager(), |
1194 | 1194 | $c->getRequest() |
1195 | 1195 | ); |
1196 | 1196 | }); |
1197 | 1197 | |
1198 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
1198 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1199 | 1199 | $config = $c->getConfig(); |
1200 | 1200 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1201 | 1201 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1244,7 +1244,7 @@ discard block |
||
1244 | 1244 | $this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class); |
1245 | 1245 | $this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class); |
1246 | 1246 | |
1247 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1247 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1248 | 1248 | $manager = new \OC\Settings\Manager( |
1249 | 1249 | $c->getLogger(), |
1250 | 1250 | $c->getL10NFactory(), |
@@ -1253,36 +1253,36 @@ discard block |
||
1253 | 1253 | ); |
1254 | 1254 | return $manager; |
1255 | 1255 | }); |
1256 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1256 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1257 | 1257 | return new \OC\Files\AppData\Factory( |
1258 | 1258 | $c->getRootFolder(), |
1259 | 1259 | $c->getSystemConfig() |
1260 | 1260 | ); |
1261 | 1261 | }); |
1262 | 1262 | |
1263 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1264 | - return new LockdownManager(function () use ($c) { |
|
1263 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1264 | + return new LockdownManager(function() use ($c) { |
|
1265 | 1265 | return $c->getSession(); |
1266 | 1266 | }); |
1267 | 1267 | }); |
1268 | 1268 | |
1269 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1269 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1270 | 1270 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1271 | 1271 | }); |
1272 | 1272 | |
1273 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1273 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1274 | 1274 | return new CloudIdManager(); |
1275 | 1275 | }); |
1276 | 1276 | |
1277 | - $this->registerService(IConfig::class, function (Server $c) { |
|
1277 | + $this->registerService(IConfig::class, function(Server $c) { |
|
1278 | 1278 | return new GlobalScale\Config($c->getConfig()); |
1279 | 1279 | }); |
1280 | 1280 | |
1281 | - $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
1281 | + $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1282 | 1282 | return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
1283 | 1283 | }); |
1284 | 1284 | |
1285 | - $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1285 | + $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1286 | 1286 | return new CloudFederationFactory(); |
1287 | 1287 | }); |
1288 | 1288 | |
@@ -1292,18 +1292,18 @@ discard block |
||
1292 | 1292 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1293 | 1293 | $this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1294 | 1294 | |
1295 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1295 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1296 | 1296 | return new Defaults( |
1297 | 1297 | $c->getThemingDefaults() |
1298 | 1298 | ); |
1299 | 1299 | }); |
1300 | 1300 | $this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class); |
1301 | 1301 | |
1302 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1302 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1303 | 1303 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1304 | 1304 | }); |
1305 | 1305 | |
1306 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1306 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1307 | 1307 | return new ShareHelper( |
1308 | 1308 | $c->query(\OCP\Share\IManager::class) |
1309 | 1309 | ); |
@@ -1392,11 +1392,11 @@ discard block |
||
1392 | 1392 | // no avatar to remove |
1393 | 1393 | } catch (\Exception $e) { |
1394 | 1394 | // Ignore exceptions |
1395 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1395 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1396 | 1396 | } |
1397 | 1397 | }); |
1398 | 1398 | |
1399 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1399 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1400 | 1400 | $manager = $this->getAvatarManager(); |
1401 | 1401 | /** @var IUser $user */ |
1402 | 1402 | $user = $e->getSubject(); |
@@ -1552,7 +1552,7 @@ discard block |
||
1552 | 1552 | * @deprecated since 9.2.0 use IAppData |
1553 | 1553 | */ |
1554 | 1554 | public function getAppFolder() { |
1555 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1555 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1556 | 1556 | $root = $this->getRootFolder(); |
1557 | 1557 | if (!$root->nodeExists($dir)) { |
1558 | 1558 | $folder = $root->newFolder($dir); |
@@ -2130,7 +2130,7 @@ discard block |
||
2130 | 2130 | /** |
2131 | 2131 | * @return \OCP\Collaboration\AutoComplete\IManager |
2132 | 2132 | */ |
2133 | - public function getAutoCompleteManager(){ |
|
2133 | + public function getAutoCompleteManager() { |
|
2134 | 2134 | return $this->query(IManager::class); |
2135 | 2135 | } |
2136 | 2136 | |
@@ -2226,11 +2226,11 @@ discard block |
||
2226 | 2226 | } |
2227 | 2227 | |
2228 | 2228 | private function registerDeprecatedAlias(string $alias, string $target) { |
2229 | - $this->registerService($alias, function (IContainer $container) use ($target, $alias) { |
|
2229 | + $this->registerService($alias, function(IContainer $container) use ($target, $alias) { |
|
2230 | 2230 | try { |
2231 | 2231 | /** @var ILogger $logger */ |
2232 | 2232 | $logger = $container->query(ILogger::class); |
2233 | - $logger->debug('The requested alias "' . $alias . '" is depreacted. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2233 | + $logger->debug('The requested alias "'.$alias.'" is depreacted. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2234 | 2234 | } catch (QueryException $e) { |
2235 | 2235 | // Could not get logger. Continue |
2236 | 2236 | } |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | $params = []; |
94 | 94 | if (count($ids) == 1 && isset($uidOwner)) { |
95 | 95 | // FIXME: don't concat $parents, use Docrine's PARAM_INT_ARRAY approach |
96 | - $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, ' . |
|
97 | - '`item_target`, `file_target`, `parent` ' . |
|
98 | - 'FROM `*PREFIX*share` ' . |
|
96 | + $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, '. |
|
97 | + '`item_target`, `file_target`, `parent` '. |
|
98 | + 'FROM `*PREFIX*share` '. |
|
99 | 99 | 'WHERE `parent` IN ('.$parents.') AND `uid_owner` = ? '; |
100 | 100 | $params[] = $uidOwner; |
101 | 101 | } else { |
102 | - $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, ' . |
|
103 | - '`item_target`, `file_target`, `parent`, `uid_owner` ' . |
|
102 | + $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, '. |
|
103 | + '`item_target`, `file_target`, `parent`, `uid_owner` '. |
|
104 | 104 | 'FROM `*PREFIX*share` WHERE `parent` IN ('.$parents.') '; |
105 | 105 | } |
106 | 106 | if ($excludeGroupChildren) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | 'shareWith' => $item['share_with'], |
118 | 118 | 'itemTarget' => $item['item_target'], |
119 | 119 | 'itemType' => $item['item_type'], |
120 | - 'shareType' => (int)$item['share_type'], |
|
120 | + 'shareType' => (int) $item['share_type'], |
|
121 | 121 | ]; |
122 | 122 | if (isset($item['file_target'])) { |
123 | 123 | $tmpItem['fileTarget'] = $item['file_target']; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | if ($defaultExpireDate === 'yes') { |
169 | 169 | $enforceExpireDate = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'); |
170 | 170 | $defaultExpireSettings['defaultExpireDateSet'] = true; |
171 | - $defaultExpireSettings['expireAfterDays'] = (int)$config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
171 | + $defaultExpireSettings['expireAfterDays'] = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
172 | 172 | $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes'; |
173 | 173 | } |
174 | 174 |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * Callback function for usort. http://php.net/usort |
54 | 54 | */ |
55 | 55 | public function sort($a, $b) { |
56 | - if(!isset($a[$this->key]) || !isset($b[$this->key])) { |
|
57 | - if(!is_null($this->log)) { |
|
58 | - $this->log->error('Sharing dialogue: cannot sort due to ' . |
|
56 | + if (!isset($a[$this->key]) || !isset($b[$this->key])) { |
|
57 | + if (!is_null($this->log)) { |
|
58 | + $this->log->error('Sharing dialogue: cannot sort due to '. |
|
59 | 59 | 'missing array key', ['app' => 'core']); |
60 | 60 | } |
61 | 61 | return 0; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $i = mb_strpos($nameA, $this->search, 0, $this->encoding); |
66 | 66 | $j = mb_strpos($nameB, $this->search, 0, $this->encoding); |
67 | 67 | |
68 | - if($i === $j || $i > 0 && $j > 0) { |
|
68 | + if ($i === $j || $i > 0 && $j > 0) { |
|
69 | 69 | return strcmp(mb_strtolower($nameA, $this->encoding), |
70 | 70 | mb_strtolower($nameB, $this->encoding)); |
71 | 71 | } elseif ($i === 0) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | $select = self::createSelectStatement(self::FORMAT_NONE, $fileDependent); |
152 | 152 | |
153 | - $where .= ' `' . $column . '` = ? AND `item_type` = ? '; |
|
153 | + $where .= ' `'.$column.'` = ? AND `item_type` = ? '; |
|
154 | 154 | $arguments = [$itemSource, $itemType]; |
155 | 155 | // for link shares $user === null |
156 | 156 | if ($user !== null) { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $arguments[] = $owner; |
169 | 169 | } |
170 | 170 | |
171 | - $query = \OC_DB::prepare('SELECT ' . $select . ' FROM `*PREFIX*share` '. $fileDependentWhere . $where); |
|
171 | + $query = \OC_DB::prepare('SELECT '.$select.' FROM `*PREFIX*share` '.$fileDependentWhere.$where); |
|
172 | 172 | |
173 | 173 | $result = \OC_DB::executeAudited($query, $arguments); |
174 | 174 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | if ($fileDependent && !self::isFileReachable($row['path'], $row['storage_id'])) { |
177 | 177 | continue; |
178 | 178 | } |
179 | - if ($fileDependent && (int)$row['file_parent'] === -1) { |
|
179 | + if ($fileDependent && (int) $row['file_parent'] === -1) { |
|
180 | 180 | // if it is a mount point we need to get the path from the mount manager |
181 | 181 | $mountManager = \OC\Files\Filesystem::getMountManager(); |
182 | 182 | $mountPoint = $mountManager->findByStorageId($row['storage_id']); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $row['path'] = $path; |
188 | 188 | } else { |
189 | 189 | \OC::$server->getLogger()->warning( |
190 | - 'Could not resolve mount point for ' . $row['storage_id'], |
|
190 | + 'Could not resolve mount point for '.$row['storage_id'], |
|
191 | 191 | ['app' => 'OCP\Share'] |
192 | 192 | ); |
193 | 193 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | //if didn't found a result than let's look for a group share. |
199 | - if(empty($shares) && $user !== null) { |
|
199 | + if (empty($shares) && $user !== null) { |
|
200 | 200 | $userObject = \OC::$server->getUserManager()->get($user); |
201 | 201 | $groups = []; |
202 | 202 | if ($userObject) { |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | if (!empty($groups)) { |
207 | - $where = $fileDependentWhere . ' WHERE `' . $column . '` = ? AND `item_type` = ? AND `share_with` in (?)'; |
|
207 | + $where = $fileDependentWhere.' WHERE `'.$column.'` = ? AND `item_type` = ? AND `share_with` in (?)'; |
|
208 | 208 | $arguments = [$itemSource, $itemType, $groups]; |
209 | 209 | $types = [null, null, IQueryBuilder::PARAM_STR_ARRAY]; |
210 | 210 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | // class isn't static anymore... |
219 | 219 | $conn = \OC::$server->getDatabaseConnection(); |
220 | 220 | $result = $conn->executeQuery( |
221 | - 'SELECT ' . $select . ' FROM `*PREFIX*share` ' . $where, |
|
221 | + 'SELECT '.$select.' FROM `*PREFIX*share` '.$where, |
|
222 | 222 | $arguments, |
223 | 223 | $types |
224 | 224 | ); |
@@ -352,12 +352,12 @@ discard block |
||
352 | 352 | $currentUser = $owner ? $owner : \OC_User::getUser(); |
353 | 353 | foreach ($items as $item) { |
354 | 354 | // delete the item with the expected share_type and owner |
355 | - if ((int)$item['share_type'] === (int)$shareType && $item['uid_owner'] === $currentUser) { |
|
355 | + if ((int) $item['share_type'] === (int) $shareType && $item['uid_owner'] === $currentUser) { |
|
356 | 356 | $toDelete = $item; |
357 | 357 | // if there is more then one result we don't have to delete the children |
358 | 358 | // but update their parent. For group shares the new parent should always be |
359 | 359 | // the original group share and not the db entry with the unique name |
360 | - } else if ((int)$item['share_type'] === self::$shareTypeGroupUserUnique) { |
|
360 | + } else if ((int) $item['share_type'] === self::$shareTypeGroupUserUnique) { |
|
361 | 361 | $newParent = $item['parent']; |
362 | 362 | } else { |
363 | 363 | $newParent = $item['id']; |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | */ |
417 | 417 | protected static function unshareItem(array $item, $newParent = null) { |
418 | 418 | |
419 | - $shareType = (int)$item['share_type']; |
|
419 | + $shareType = (int) $item['share_type']; |
|
420 | 420 | $shareWith = null; |
421 | 421 | if ($shareType !== \OCP\Share::SHARE_TYPE_LINK) { |
422 | 422 | $shareWith = $item['share_with']; |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | 'itemParent' => $item['parent'], |
433 | 433 | 'uidOwner' => $item['uid_owner'], |
434 | 434 | ]; |
435 | - if($item['item_type'] === 'file' || $item['item_type'] === 'folder') { |
|
435 | + if ($item['item_type'] === 'file' || $item['item_type'] === 'folder') { |
|
436 | 436 | $hookParams['fileSource'] = $item['file_source']; |
437 | 437 | $hookParams['fileTarget'] = $item['file_target']; |
438 | 438 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $deletedShares[] = $hookParams; |
443 | 443 | $hookParams['deletedShares'] = $deletedShares; |
444 | 444 | \OC_Hook::emit(\OCP\Share::class, 'post_unshare', $hookParams); |
445 | - if ((int)$item['share_type'] === \OCP\Share::SHARE_TYPE_REMOTE && \OC::$server->getUserSession()->getUser()) { |
|
445 | + if ((int) $item['share_type'] === \OCP\Share::SHARE_TYPE_REMOTE && \OC::$server->getUserSession()->getUser()) { |
|
446 | 446 | list(, $remote) = Helper::splitUserRemote($item['share_with']); |
447 | 447 | self::sendRemoteUnshare($remote, $item['id'], $item['token']); |
448 | 448 | } |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | // Get filesystem root to add it to the file target and remove from the |
607 | 607 | // file source, match file_source with the file cache |
608 | 608 | if ($itemType == 'file' || $itemType == 'folder') { |
609 | - if(!is_null($uidOwner)) { |
|
609 | + if (!is_null($uidOwner)) { |
|
610 | 610 | $root = \OC\Files\Filesystem::getRoot(); |
611 | 611 | } else { |
612 | 612 | $root = ''; |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | $result = $query->execute($queryArgs); |
752 | 752 | if ($result === false) { |
753 | 753 | \OCP\Util::writeLog('OCP\Share', |
754 | - \OC_DB::getErrorMessage() . ', select=' . $select . ' where=', |
|
754 | + \OC_DB::getErrorMessage().', select='.$select.' where=', |
|
755 | 755 | ILogger::ERROR); |
756 | 756 | } |
757 | 757 | $items = []; |
@@ -793,14 +793,14 @@ discard block |
||
793 | 793 | } |
794 | 794 | // Switch ids if sharing permission is granted on only |
795 | 795 | // one share to ensure correct parent is used if resharing |
796 | - if (~(int)$items[$id]['permissions'] & \OCP\Constants::PERMISSION_SHARE |
|
797 | - && (int)$row['permissions'] & \OCP\Constants::PERMISSION_SHARE) { |
|
796 | + if (~(int) $items[$id]['permissions'] & \OCP\Constants::PERMISSION_SHARE |
|
797 | + && (int) $row['permissions'] & \OCP\Constants::PERMISSION_SHARE) { |
|
798 | 798 | $items[$row['id']] = $items[$id]; |
799 | 799 | $switchedItems[$id] = $row['id']; |
800 | 800 | unset($items[$id]); |
801 | 801 | $id = $row['id']; |
802 | 802 | } |
803 | - $items[$id]['permissions'] |= (int)$row['permissions']; |
|
803 | + $items[$id]['permissions'] |= (int) $row['permissions']; |
|
804 | 804 | |
805 | 805 | } |
806 | 806 | continue; |
@@ -814,8 +814,8 @@ discard block |
||
814 | 814 | $query = \OC_DB::prepare('SELECT `file_target` FROM `*PREFIX*share` WHERE `id` = ?'); |
815 | 815 | $parentResult = $query->execute([$row['parent']]); |
816 | 816 | if ($result === false) { |
817 | - \OCP\Util::writeLog('OCP\Share', 'Can\'t select parent: ' . |
|
818 | - \OC_DB::getErrorMessage() . ', select=' . $select . ' where=' . $where, |
|
817 | + \OCP\Util::writeLog('OCP\Share', 'Can\'t select parent: '. |
|
818 | + \OC_DB::getErrorMessage().', select='.$select.' where='.$where, |
|
819 | 819 | ILogger::ERROR); |
820 | 820 | } else { |
821 | 821 | $parentRow = $parentResult->fetchRow(); |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | $subPath = substr($row['path'], $pos); |
826 | 826 | $splitPath = explode('/', $subPath); |
827 | 827 | foreach (array_slice($splitPath, 2) as $pathPart) { |
828 | - $tmpPath = $tmpPath . '/' . $pathPart; |
|
828 | + $tmpPath = $tmpPath.'/'.$pathPart; |
|
829 | 829 | } |
830 | 830 | $row['path'] = $tmpPath; |
831 | 831 | } |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | } |
845 | 845 | } |
846 | 846 | |
847 | - if($checkExpireDate) { |
|
847 | + if ($checkExpireDate) { |
|
848 | 848 | if (self::expireItem($row)) { |
849 | 849 | continue; |
850 | 850 | } |
@@ -855,11 +855,11 @@ discard block |
||
855 | 855 | } |
856 | 856 | // Add display names to result |
857 | 857 | $row['share_with_displayname'] = $row['share_with']; |
858 | - if ( isset($row['share_with']) && $row['share_with'] != '' && |
|
858 | + if (isset($row['share_with']) && $row['share_with'] != '' && |
|
859 | 859 | $row['share_type'] === self::SHARE_TYPE_USER) { |
860 | 860 | $shareWithUser = \OC::$server->getUserManager()->get($row['share_with']); |
861 | 861 | $row['share_with_displayname'] = $shareWithUser === null ? $row['share_with'] : $shareWithUser->getDisplayName(); |
862 | - } else if(isset($row['share_with']) && $row['share_with'] != '' && |
|
862 | + } else if (isset($row['share_with']) && $row['share_with'] != '' && |
|
863 | 863 | $row['share_type'] === self::SHARE_TYPE_REMOTE) { |
864 | 864 | $addressBookEntries = \OC::$server->getContactsManager()->search($row['share_with'], ['CLOUD']); |
865 | 865 | foreach ($addressBookEntries as $entry) { |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | } |
871 | 871 | } |
872 | 872 | } |
873 | - if ( isset($row['uid_owner']) && $row['uid_owner'] != '') { |
|
873 | + if (isset($row['uid_owner']) && $row['uid_owner'] != '') { |
|
874 | 874 | $ownerUser = \OC::$server->getUserManager()->get($row['uid_owner']); |
875 | 875 | $row['displayname_owner'] = $ownerUser === null ? $row['uid_owner'] : $ownerUser->getDisplayName(); |
876 | 876 | } |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | // for file/folder shares we need to compare file_source, otherwise we compare item_source |
1020 | 1020 | // only group shares if they already point to the same target, otherwise the file where shared |
1021 | 1021 | // before grouping of shares was added. In this case we don't group them toi avoid confusions |
1022 | - if (( $fileSharing && $item['file_source'] === $r['file_source'] && $item['file_target'] === $r['file_target']) || |
|
1022 | + if (($fileSharing && $item['file_source'] === $r['file_source'] && $item['file_target'] === $r['file_target']) || |
|
1023 | 1023 | (!$fileSharing && $item['item_source'] === $r['item_source'] && $item['item_target'] === $r['item_target'])) { |
1024 | 1024 | // add the first item to the list of grouped shares |
1025 | 1025 | if (!isset($result[$key]['grouped'])) { |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | $groupItemTarget = $itemTarget = $fileSource = $parent = 0; |
1065 | 1065 | |
1066 | 1066 | $result = self::checkReshare('test', $itemSource, self::SHARE_TYPE_USER, $shareWith, $uidOwner, $permissions, null, null); |
1067 | - if(!empty($result)) { |
|
1067 | + if (!empty($result)) { |
|
1068 | 1068 | $parent = $result['parent']; |
1069 | 1069 | $itemSource = $result['itemSource']; |
1070 | 1070 | $fileSource = $result['fileSource']; |
@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | $fileTarget = $sourceExists['file_target']; |
1113 | 1113 | $itemTarget = $sourceExists['item_target']; |
1114 | 1114 | |
1115 | - } elseif(!$sourceExists) { |
|
1115 | + } elseif (!$sourceExists) { |
|
1116 | 1116 | |
1117 | 1117 | $itemTarget = Helper::generateTarget($itemType, $itemSource, $userShareType, $user, |
1118 | 1118 | $uidOwner, $suggestedItemTarget, $parent); |
@@ -1223,8 +1223,8 @@ discard block |
||
1223 | 1223 | |
1224 | 1224 | if ($checkReshare && $checkReshare['uid_owner'] !== \OC_User::getUser()) { |
1225 | 1225 | // Check if share permissions is granted |
1226 | - if (self::isResharingAllowed() && (int)$checkReshare['permissions'] & \OCP\Constants::PERMISSION_SHARE) { |
|
1227 | - if (~(int)$checkReshare['permissions'] & $permissions) { |
|
1226 | + if (self::isResharingAllowed() && (int) $checkReshare['permissions'] & \OCP\Constants::PERMISSION_SHARE) { |
|
1227 | + if (~(int) $checkReshare['permissions'] & $permissions) { |
|
1228 | 1228 | $message = 'Sharing %1$s failed, because the permissions exceed permissions granted to %2$s'; |
1229 | 1229 | throw new \Exception(sprintf($message, $itemSourceName, $uidOwner)); |
1230 | 1230 | } else { |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | |
1234 | 1234 | $result['expirationDate'] = $expirationDate; |
1235 | 1235 | // $checkReshare['expiration'] could be null and then is always less than any value |
1236 | - if(isset($checkReshare['expiration']) && $checkReshare['expiration'] < $expirationDate) { |
|
1236 | + if (isset($checkReshare['expiration']) && $checkReshare['expiration'] < $expirationDate) { |
|
1237 | 1237 | $result['expirationDate'] = $checkReshare['expiration']; |
1238 | 1238 | } |
1239 | 1239 | |
@@ -1313,7 +1313,7 @@ discard block |
||
1313 | 1313 | |
1314 | 1314 | $id = false; |
1315 | 1315 | if ($result) { |
1316 | - $id = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*share'); |
|
1316 | + $id = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*share'); |
|
1317 | 1317 | } |
1318 | 1318 | |
1319 | 1319 | return $id; |
@@ -1415,7 +1415,7 @@ discard block |
||
1415 | 1415 | * @param array $parameters additional format parameters |
1416 | 1416 | * @return array format result |
1417 | 1417 | */ |
1418 | - private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE , $parameters = null) { |
|
1418 | + private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE, $parameters = null) { |
|
1419 | 1419 | if ($format === self::FORMAT_NONE) { |
1420 | 1420 | return $items; |
1421 | 1421 | } else if ($format === self::FORMAT_STATUSES) { |
@@ -1472,13 +1472,13 @@ discard block |
||
1472 | 1472 | $try = 0; |
1473 | 1473 | $discoveryService = \OC::$server->query(\OCP\OCS\IDiscoveryService::class); |
1474 | 1474 | while ($result['success'] === false && $try < 2) { |
1475 | - $federationEndpoints = $discoveryService->discover($protocol . $remoteDomain, 'FEDERATED_SHARING'); |
|
1475 | + $federationEndpoints = $discoveryService->discover($protocol.$remoteDomain, 'FEDERATED_SHARING'); |
|
1476 | 1476 | $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares'; |
1477 | 1477 | $client = \OC::$server->getHTTPClientService()->newClient(); |
1478 | 1478 | |
1479 | 1479 | try { |
1480 | 1480 | $response = $client->post( |
1481 | - $protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, |
|
1481 | + $protocol.$remoteDomain.$endpoint.$urlSuffix.'?format='.self::RESPONSE_FORMAT, |
|
1482 | 1482 | [ |
1483 | 1483 | 'body' => $fields, |
1484 | 1484 | 'connect_timeout' => 10, |
@@ -1519,7 +1519,7 @@ discard block |
||
1519 | 1519 | * @return int |
1520 | 1520 | */ |
1521 | 1521 | public static function getExpireInterval() { |
1522 | - return (int)\OC::$server->getConfig()->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1522 | + return (int) \OC::$server->getConfig()->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1523 | 1523 | } |
1524 | 1524 | |
1525 | 1525 | /** |
@@ -63,41 +63,41 @@ discard block |
||
63 | 63 | * @param string $renderAs |
64 | 64 | * @param string $appId application id |
65 | 65 | */ |
66 | - public function __construct( $renderAs, $appId = '' ) { |
|
66 | + public function __construct($renderAs, $appId = '') { |
|
67 | 67 | |
68 | 68 | // yes - should be injected .... |
69 | 69 | $this->config = \OC::$server->getConfig(); |
70 | 70 | |
71 | - if(\OCP\Util::isIE()) { |
|
71 | + if (\OCP\Util::isIE()) { |
|
72 | 72 | \OC_Util::addStyle('ie'); |
73 | 73 | } |
74 | 74 | |
75 | 75 | // Decide which page we show |
76 | - if($renderAs === 'user') { |
|
77 | - parent::__construct( 'core', 'layout.user' ); |
|
78 | - if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { |
|
76 | + if ($renderAs === 'user') { |
|
77 | + parent::__construct('core', 'layout.user'); |
|
78 | + if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) { |
|
79 | 79 | $this->assign('bodyid', 'body-settings'); |
80 | - }else{ |
|
80 | + } else { |
|
81 | 81 | $this->assign('bodyid', 'body-user'); |
82 | 82 | } |
83 | 83 | |
84 | 84 | // Add navigation entry |
85 | - $this->assign( 'application', ''); |
|
86 | - $this->assign( 'appid', $appId ); |
|
85 | + $this->assign('application', ''); |
|
86 | + $this->assign('appid', $appId); |
|
87 | 87 | $navigation = \OC::$server->getNavigationManager()->getAll(); |
88 | - $this->assign( 'navigation', $navigation); |
|
88 | + $this->assign('navigation', $navigation); |
|
89 | 89 | $settingsNavigation = \OC::$server->getNavigationManager()->getAll('settings'); |
90 | - $this->assign( 'settingsnavigation', $settingsNavigation); |
|
91 | - foreach($navigation as $entry) { |
|
90 | + $this->assign('settingsnavigation', $settingsNavigation); |
|
91 | + foreach ($navigation as $entry) { |
|
92 | 92 | if ($entry['active']) { |
93 | - $this->assign( 'application', $entry['name'] ); |
|
93 | + $this->assign('application', $entry['name']); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
98 | - foreach($settingsNavigation as $entry) { |
|
98 | + foreach ($settingsNavigation as $entry) { |
|
99 | 99 | if ($entry['active']) { |
100 | - $this->assign( 'application', $entry['name'] ); |
|
100 | + $this->assign('application', $entry['name']); |
|
101 | 101 | break; |
102 | 102 | } |
103 | 103 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $this->assign('user_uid', \OC_User::getUser()); |
139 | 139 | } else if ($renderAs === 'public') { |
140 | 140 | parent::__construct('core', 'layout.public'); |
141 | - $this->assign( 'appid', $appId ); |
|
141 | + $this->assign('appid', $appId); |
|
142 | 142 | $this->assign('bodyid', 'body-public'); |
143 | 143 | |
144 | 144 | /** @var IRegistry $subscription */ |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->assign('language', $lang); |
161 | 161 | $this->assign('locale', $locale); |
162 | 162 | |
163 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
163 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
164 | 164 | if (empty(self::$versionHash)) { |
165 | 165 | $v = \OC_App::getAppVersions(); |
166 | 166 | $v['core'] = implode('.', \OCP\Util::getVersion()); |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | $this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash])); |
193 | 193 | } |
194 | 194 | } |
195 | - foreach($jsFiles as $info) { |
|
195 | + foreach ($jsFiles as $info) { |
|
196 | 196 | $web = $info[1]; |
197 | 197 | $file = $info[2]; |
198 | - $this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
198 | + $this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | try { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | // Do not initialise scss appdata until we have a fully installed instance |
208 | 208 | // Do not load scss for update, errors, installation or login page |
209 | - if(\OC::$server->getSystemConfig()->getValue('installed', false) |
|
209 | + if (\OC::$server->getSystemConfig()->getValue('installed', false) |
|
210 | 210 | && !\OCP\Util::needUpgrade() |
211 | 211 | && $pathInfo !== '' |
212 | 212 | && !preg_match('/^\/login/', $pathInfo) |
@@ -223,19 +223,19 @@ discard block |
||
223 | 223 | $this->assign('cssfiles', []); |
224 | 224 | $this->assign('printcssfiles', []); |
225 | 225 | $this->assign('versionHash', self::$versionHash); |
226 | - foreach($cssFiles as $info) { |
|
226 | + foreach ($cssFiles as $info) { |
|
227 | 227 | $web = $info[1]; |
228 | 228 | $file = $info[2]; |
229 | 229 | |
230 | 230 | if (substr($file, -strlen('print.css')) === 'print.css') { |
231 | - $this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
231 | + $this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
232 | 232 | } else { |
233 | 233 | $suffix = $this->getVersionHashSuffix($web, $file); |
234 | 234 | |
235 | 235 | if (strpos($file, '?v=') == false) { |
236 | - $this->append( 'cssfiles', $web.'/'.$file . $suffix); |
|
236 | + $this->append('cssfiles', $web.'/'.$file.$suffix); |
|
237 | 237 | } else { |
238 | - $this->append( 'cssfiles', $web.'/'.$file . '-' . substr($suffix, 3)); |
|
238 | + $this->append('cssfiles', $web.'/'.$file.'-'.substr($suffix, 3)); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | if ($this->config->getSystemValue('installed', false)) { |
263 | 263 | if (\OC::$server->getAppManager()->isInstalled('theming')) { |
264 | - $themingSuffix = '-' . $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
264 | + $themingSuffix = '-'.$this->config->getAppValue('theming', 'cachebuster', '0'); |
|
265 | 265 | } |
266 | 266 | $v = \OC_App::getAppVersions(); |
267 | 267 | } |
@@ -269,21 +269,21 @@ discard block |
||
269 | 269 | // Try the webroot path for a match |
270 | 270 | if ($path !== false && $path !== '') { |
271 | 271 | $appName = $this->getAppNamefromPath($path); |
272 | - if(array_key_exists($appName, $v)) { |
|
272 | + if (array_key_exists($appName, $v)) { |
|
273 | 273 | $appVersion = $v[$appName]; |
274 | - return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix; |
|
274 | + return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix; |
|
275 | 275 | } |
276 | 276 | } |
277 | 277 | // fallback to the file path instead |
278 | 278 | if ($file !== false && $file !== '') { |
279 | 279 | $appName = $this->getAppNamefromPath($file); |
280 | - if(array_key_exists($appName, $v)) { |
|
280 | + if (array_key_exists($appName, $v)) { |
|
281 | 281 | $appVersion = $v[$appName]; |
282 | - return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix; |
|
282 | + return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix; |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
286 | - return '?v=' . self::$versionHash . $themingSuffix; |
|
286 | + return '?v='.self::$versionHash.$themingSuffix; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | /** |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | // Read the selected theme from the config file |
295 | 295 | $theme = \OC_Util::getTheme(); |
296 | 296 | |
297 | - if($compileScss) { |
|
297 | + if ($compileScss) { |
|
298 | 298 | $SCSSCacher = \OC::$server->query(SCSSCacher::class); |
299 | 299 | } else { |
300 | 300 | $SCSSCacher = null; |
@@ -303,8 +303,8 @@ discard block |
||
303 | 303 | $locator = new \OC\Template\CSSResourceLocator( |
304 | 304 | \OC::$server->getLogger(), |
305 | 305 | $theme, |
306 | - [ \OC::$SERVERROOT => \OC::$WEBROOT ], |
|
307 | - [ \OC::$SERVERROOT => \OC::$WEBROOT ], |
|
306 | + [\OC::$SERVERROOT => \OC::$WEBROOT], |
|
307 | + [\OC::$SERVERROOT => \OC::$WEBROOT], |
|
308 | 308 | $SCSSCacher |
309 | 309 | ); |
310 | 310 | $locator->find($styles); |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | $locator = new \OC\Template\JSResourceLocator( |
340 | 340 | \OC::$server->getLogger(), |
341 | 341 | $theme, |
342 | - [ \OC::$SERVERROOT => \OC::$WEBROOT ], |
|
343 | - [ \OC::$SERVERROOT => \OC::$WEBROOT ], |
|
342 | + [\OC::$SERVERROOT => \OC::$WEBROOT], |
|
343 | + [\OC::$SERVERROOT => \OC::$WEBROOT], |
|
344 | 344 | \OC::$server->query(JSCombiner::class) |
345 | 345 | ); |
346 | 346 | $locator->find($scripts); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | public static function convertToRelativePath($filePath) { |
357 | 357 | $relativePath = explode(\OC::$SERVERROOT, $filePath); |
358 | - if(count($relativePath) !== 2) { |
|
358 | + if (count($relativePath) !== 2) { |
|
359 | 359 | throw new \Exception('$filePath is not under the \OC::$SERVERROOT'); |
360 | 360 | } |
361 | 361 |
@@ -96,20 +96,20 @@ discard block |
||
96 | 96 | |
97 | 97 | $cachedGroups = &$this->cachedGroups; |
98 | 98 | $cachedUserGroups = &$this->cachedUserGroups; |
99 | - $this->listen('\OC\Group', 'postDelete', function ($group) use (&$cachedGroups, &$cachedUserGroups) { |
|
99 | + $this->listen('\OC\Group', 'postDelete', function($group) use (&$cachedGroups, &$cachedUserGroups) { |
|
100 | 100 | /** |
101 | 101 | * @var \OC\Group\Group $group |
102 | 102 | */ |
103 | 103 | unset($cachedGroups[$group->getGID()]); |
104 | 104 | $cachedUserGroups = []; |
105 | 105 | }); |
106 | - $this->listen('\OC\Group', 'postAddUser', function ($group) use (&$cachedUserGroups) { |
|
106 | + $this->listen('\OC\Group', 'postAddUser', function($group) use (&$cachedUserGroups) { |
|
107 | 107 | /** |
108 | 108 | * @var \OC\Group\Group $group |
109 | 109 | */ |
110 | 110 | $cachedUserGroups = []; |
111 | 111 | }); |
112 | - $this->listen('\OC\Group', 'postRemoveUser', function ($group) use (&$cachedUserGroups) { |
|
112 | + $this->listen('\OC\Group', 'postRemoveUser', function($group) use (&$cachedUserGroups) { |
|
113 | 113 | /** |
114 | 114 | * @var \OC\Group\Group $group |
115 | 115 | */ |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | if ($aGroup instanceof IGroup) { |
250 | 250 | $groups[$groupId] = $aGroup; |
251 | 251 | } else { |
252 | - $this->logger->debug('Group "' . $groupId . '" was returned by search but not found through direct access', ['app' => 'core']); |
|
252 | + $this->logger->debug('Group "'.$groupId.'" was returned by search but not found through direct access', ['app' => 'core']); |
|
253 | 253 | } |
254 | 254 | } |
255 | 255 | if (!is_null($limit) and $limit <= 0) { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | if ($aGroup instanceof IGroup) { |
288 | 288 | $groups[$groupId] = $aGroup; |
289 | 289 | } else { |
290 | - $this->logger->debug('User "' . $uid . '" belongs to deleted group: "' . $groupId . '"', ['app' => 'core']); |
|
290 | + $this->logger->debug('User "'.$uid.'" belongs to deleted group: "'.$groupId.'"', ['app' => 'core']); |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | } |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | * @return array with group ids |
330 | 330 | */ |
331 | 331 | public function getUserGroupIds(IUser $user) { |
332 | - return array_map(function ($value) { |
|
333 | - return (string)$value; |
|
332 | + return array_map(function($value) { |
|
333 | + return (string) $value; |
|
334 | 334 | }, array_keys($this->getUserGroups($user))); |
335 | 335 | } |
336 | 336 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | * @return array ['displayName' => displayname] |
342 | 342 | */ |
343 | 343 | public function getUserGroupNames(IUser $user) { |
344 | - return array_map(function ($group) { |
|
344 | + return array_map(function($group) { |
|
345 | 345 | return ['displayName' => $group->getDisplayName()]; |
346 | 346 | }, $this->getUserGroups($user)); |
347 | 347 | } |