diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-25 23:16:13 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-01-29 12:03:47 +0100 |
commit | eb51f06a3b9e42686f462b9f7a56411d3fe6cb27 (patch) | |
tree | 0d96c86c4489b4e3fe60bcceaeb6759d856a36e9 /lib/private/AppFramework | |
parent | 1d8b90b8d3c8a85104d223b7f1d5693280370774 (diff) | |
download | nextcloud-server-eb51f06a3b9e42686f462b9f7a56411d3fe6cb27.tar.gz nextcloud-server-eb51f06a3b9e42686f462b9f7a56411d3fe6cb27.zip |
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r-- | lib/private/AppFramework/App.php | 8 | ||||
-rw-r--r-- | lib/private/AppFramework/DependencyInjection/DIContainer.php | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php index 653000ab726..6e8c3736fdb 100644 --- a/lib/private/AppFramework/App.php +++ b/lib/private/AppFramework/App.php @@ -33,6 +33,8 @@ use OC\AppFramework\DependencyInjection\DIContainer; use OCP\AppFramework\Http; use OCP\AppFramework\QueryException; use OCP\AppFramework\Http\ICallbackResponse; +use OCP\AppFramework\Http\IOutput; +use OCP\IRequest; /** * Entry point for every request in your app. You can consider this as your @@ -81,9 +83,9 @@ class App { */ public static function main($controllerName, $methodName, DIContainer $container, array $urlParams = null) { if (!is_null($urlParams)) { - $container['OCP\\IRequest']->setUrlParameters($urlParams); + $container[IRequest::class]->setUrlParameters($urlParams); } else if (isset($container['urlParams']) && !is_null($container['urlParams'])) { - $container['OCP\\IRequest']->setUrlParameters($container['urlParams']); + $container[IRequest::class]->setUrlParameters($container['urlParams']); } $appName = $container['AppName']; @@ -114,7 +116,7 @@ class App { $response ) = $dispatcher->dispatch($controller, $methodName); - $io = $container['OCP\\AppFramework\\Http\\IOutput']; + $io = $container[IOutput::class]; if(!is_null($httpHeaders)) { $io->setHeader($httpHeaders); diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index d9e82819d14..5fe925c2998 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -62,6 +62,8 @@ use OCP\IServerContainer; use OCP\IUserSession; use OCP\RichObjectStrings\IValidator; use OCP\Util; +use OCP\Encryption\IManager; +use OCA\WorkflowEngine\Manager; class DIContainer extends SimpleContainer implements IAppContainer { @@ -134,7 +136,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { $this->registerAlias('ServerContainer', IServerContainer::class); $this->registerService(\OCP\WorkflowEngine\IManager::class, function ($c) { - return $c->query('OCA\WorkflowEngine\Manager'); + return $c->query(Manager::class); }); $this->registerService(\OCP\AppFramework\IAppContainer::class, function ($c) { @@ -143,7 +145,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { // commonly used attributes $this->registerService('UserId', function ($c) { - return $c->query('OCP\\IUserSession')->getSession()->get('user_id'); + return $c->query(IUserSession::class)->getSession()->get('user_id'); }); $this->registerService('WebRoot', function ($c) { @@ -158,7 +160,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { return $c->getServer()->getThemingDefaults(); }); - $this->registerService('OCP\Encryption\IManager', function ($c) { + $this->registerService(IManager::class, function ($c) { return $this->getServer()->getEncryptionManager(); }); |