diff options
author | splitt3r <splitt3r@users.noreply.github.com> | 2017-11-09 15:42:53 +0300 |
---|---|---|
committer | splitt3r <splitt3r@users.noreply.github.com> | 2017-11-09 15:42:53 +0300 |
commit | 8caf86af5b6783f4b1064d5bf2835e1bc265e308 (patch) | |
tree | e09891a4cc83974e0ef5809c94868550fc1ad742 /lib/AppInfo | |
parent | 654da24f13a8ba55f493b9f9665012f44b8a753a (diff) |
Optimized imports + type hints
Diffstat (limited to 'lib/AppInfo')
-rw-r--r-- | lib/AppInfo/Application.php | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 7febc09d..5f7c7ef4 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -25,7 +25,7 @@ namespace OCA\Polls\AppInfo; use OC\AppFramework\Utility\SimpleContainer; -use OCP\AppFramework\App; +use OCA\Polls\Controller\PageController; use OCA\Polls\Db\CommentMapper; use OCA\Polls\Db\DateMapper; use OCA\Polls\Db\EventMapper; @@ -33,7 +33,7 @@ use OCA\Polls\Db\NotificationMapper; use OCA\Polls\Db\ParticipationMapper; use OCA\Polls\Db\ParticipationTextMapper; use OCA\Polls\Db\TextMapper; -use OCA\Polls\Controller\PageController; +use OCP\AppFramework\App; class Application extends App { @@ -50,8 +50,7 @@ class Application extends App { /** * Controllers */ - $container->registerService('PageController', function ($c) use ($server) { - /** @var SimpleContainer $c */ + $container->registerService('PageController', function (SimpleContainer $c) { return new PageController( $c->query('AppName'), $c->query('Request'), @@ -72,74 +71,63 @@ class Application extends App { ); }); - $container->registerService('UserManager', function ($c) { - /** @var SimpleContainer $c */ + $container->registerService('UserManager', function (SimpleContainer $c) { return $c->query('ServerContainer')->getUserManager(); }); - $container->registerService('GroupManager', function ($c) { - /** @var SimpleContainer $c */ + $container->registerService('GroupManager', function (SimpleContainer $c) { return $c->query('ServerContainer')->getGroupManager(); }); - $container->registerService('AvatarManager', function ($c) { - /** @var SimpleContainer $c */ + $container->registerService('AvatarManager', function (SimpleContainer $c) { return $c->query('ServerContainer')->getAvatarManager(); }); - $container->registerService('Logger', function ($c) { - /** @var SimpleContainer $c */ + $container->registerService('Logger', function (SimpleContainer $c) { return $c->query('ServerContainer')->getLogger(); }); - $container->registerService('L10N', function ($c) { + $container->registerService('L10N', function (SimpleContainer $c) { return $c->query('ServerContainer')->getL10N($c->query('AppName')); }); - $container->registerService('CommentMapper', function ($c) use ($server) { - /** @var SimpleContainer $c */ + $container->registerService('CommentMapper', function (SimpleContainer $c) use ($server) { return new CommentMapper( $server->getDatabaseConnection() ); }); - $container->registerService('DateMapper', function ($c) use ($server) { - /** @var SimpleContainer $c */ + $container->registerService('DateMapper', function (SimpleContainer $c) use ($server) { return new DateMapper( $server->getDatabaseConnection() ); }); - $container->registerService('EventMapper', function ($c) use ($server) { - /** @var SimpleContainer $c */ + $container->registerService('EventMapper', function (SimpleContainer $c) use ($server) { return new EventMapper( $server->getDatabaseConnection() ); }); - $container->registerService('NotificationMapper', function ($c) use ($server) { - /** @var SimpleContainer $c */ + $container->registerService('NotificationMapper', function (SimpleContainer $c) use ($server) { return new NotificationMapper( $server->getDatabaseConnection() ); }); - $container->registerService('ParticipationMapper', function ($c) use ($server) { - /** @var SimpleContainer $c */ + $container->registerService('ParticipationMapper', function (SimpleContainer $c) use ($server) { return new ParticipationMapper( $server->getDatabaseConnection() ); }); - $container->registerService('ParticipationTextMapper', function ($c) use ($server) { - /** @var SimpleContainer $c */ + $container->registerService('ParticipationTextMapper', function (SimpleContainer $c) use ($server) { return new ParticipationTextMapper( $server->getDatabaseConnection() ); }); - $container->registerService('TextMapper', function ($c) use ($server) { - /** @var SimpleContainer $c */ + $container->registerService('TextMapper', function (SimpleContainer $c) use ($server) { return new TextMapper( $server->getDatabaseConnection() ); |