summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-08-17 17:58:41 +0200
committerGitHub <noreply@github.com>2020-08-17 17:58:41 +0200
commit7b8adb18174a9fa612a5fa316c626157abd65a94 (patch)
tree16a45b03899de9496cbdb50083afae2d96b49e35 /apps
parent00cb8e6c54d8f2a26c5770fef5fe4ae1e366d0ce (diff)
parentf406f5dc737c399f21ccee2383a928fc0df37fae (diff)
downloadnextcloud-server-7b8adb18174a9fa612a5fa316c626157abd65a94.tar.gz
nextcloud-server-7b8adb18174a9fa612a5fa316c626157abd65a94.zip
Merge pull request #21861 from nextcloud/techdebt/files-psr-container
Migrate files to the PSR container
Diffstat (limited to 'apps')
-rw-r--r--apps/files/lib/AppInfo/Application.php37
1 files changed, 22 insertions, 15 deletions
diff --git a/apps/files/lib/AppInfo/Application.php b/apps/files/lib/AppInfo/Application.php
index 08ec9fbbcc4..434fb482aa8 100644
--- a/apps/files/lib/AppInfo/Application.php
+++ b/apps/files/lib/AppInfo/Application.php
@@ -47,17 +47,24 @@ use OCA\Files\Listener\LoadSidebarListener;
use OCA\Files\Notification\Notifier;
use OCA\Files\Search\FilesSearchProvider;
use OCA\Files\Service\TagService;
+use OCP\Activity\IManager as IActivityManager;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\Collaboration\Resources\IProviderManager;
-use OCP\IContainer;
+use OCP\IConfig;
use OCP\IL10N;
+use OCP\IPreview;
use OCP\ISearch;
+use OCP\IRequest;
use OCP\IServerContainer;
+use OCP\ITagManager;
+use OCP\IUserSession;
use OCP\Notification\IManager;
+use OCP\Share\IManager as IShareManager;
use OCP\Util;
+use Psr\Container\ContainerInterface;
class Application extends App implements IBootstrap {
public const APP_ID = 'files';
@@ -70,18 +77,18 @@ class Application extends App implements IBootstrap {
/**
* Controllers
*/
- $context->registerService('APIController', function (IContainer $c) {
+ $context->registerService('APIController', function (ContainerInterface $c) {
/** @var IServerContainer $server */
- $server = $c->query(IServerContainer::class);
+ $server = $c->get(IServerContainer::class);
return new ApiController(
- $c->query('AppName'),
- $c->query('Request'),
- $server->getUserSession(),
- $c->query('TagService'),
- $server->getPreviewManager(),
- $server->getShareManager(),
- $server->getConfig(),
+ $c->get('AppName'),
+ $c->get(IRequest::class),
+ $c->get(IUserSession::class),
+ $c->get(TagService::class),
+ $c->get(IPreview::class),
+ $c->get(IShareManager::class),
+ $c->get(IConfig::class),
$server->getUserFolder()
);
});
@@ -89,14 +96,14 @@ class Application extends App implements IBootstrap {
/**
* Services
*/
- $context->registerService('TagService', function (IContainer $c) {
+ $context->registerService(TagService::class, function (ContainerInterface $c) {
/** @var IServerContainer $server */
- $server = $c->query(IServerContainer::class);
+ $server = $c->get(IServerContainer::class);
return new TagService(
- $server->getUserSession(),
- $server->getActivityManager(),
- $server->getTagManager()->load(self::APP_ID),
+ $c->get(IUserSession::class),
+ $c->get(IActivityManager::class),
+ $c->get(ITagManager::class)->load(self::APP_ID),
$server->getUserFolder(),
$server->getEventDispatcher()
);