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/Server.php | |
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/Server.php')
-rw-r--r-- | lib/private/Server.php | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index 1f572280c7c..8799223345e 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -57,11 +57,13 @@ use OC\AppFramework\Http\Request; use OC\AppFramework\Utility\SimpleContainer; use OC\AppFramework\Utility\TimeFactory; use OC\Authentication\LoginCredentials\Store; +use OC\Authentication\Token\IProvider; use OC\Collaboration\Collaborators\GroupPlugin; use OC\Collaboration\Collaborators\MailPlugin; use OC\Collaboration\Collaborators\RemotePlugin; use OC\Collaboration\Collaborators\UserPlugin; use OC\Command\CronBus; +use OC\Comments\ManagerFactory as CommentsManagerFactory; use OC\Contacts\ContactsMenu\ActionFactory; use OC\Contacts\ContactsMenu\ContactsStore; use OC\Diagnostics\EventLogger; @@ -106,7 +108,9 @@ use OC\Security\CredentialsManager; use OC\Security\SecureRandom; use OC\Security\TrustedDomainHelper; use OC\Session\CryptoWrapper; +use OC\Share20\ProviderFactory; use OC\Share20\ShareHelper; +use OC\SystemTag\ManagerFactory as SystemTagManagerFactory; use OC\Tagging\TagMapper; use OC\Template\SCSSCacher; use OCA\Theming\ThemingDefaults; @@ -132,7 +136,6 @@ use OCP\Remote\Api\IApiFactory; use OCP\Remote\IInstanceFactory; use OCP\RichObjectStrings\IValidator; use OCP\Security\IContentSecurityPolicyManager; -use OCP\Share; use OCP\Share\IShareHelper; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -242,7 +245,7 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService('SystemTagManagerFactory', function (Server $c) { $config = $c->getConfig(); - $factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory'); + $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); return new $factoryClass($this); }); $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { @@ -317,7 +320,7 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService(Store::class, function (Server $c) { $session = $c->getSession(); if (\OC::$server->getSystemConfig()->getValue('installed', false)) { - $tokenProvider = $c->query('OC\Authentication\Token\IProvider'); + $tokenProvider = $c->query(IProvider::class); } else { $tokenProvider = null; } @@ -325,19 +328,19 @@ class Server extends ServerContainer implements IServerContainer { return new Store($session, $logger, $tokenProvider); }); $this->registerAlias(IStore::class, Store::class); - $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) { + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { $dbConnection = $c->getDatabaseConnection(); return new Authentication\Token\DefaultTokenMapper($dbConnection); }); - $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) { - $mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper'); + $this->registerService(Authentication\Token\DefaultTokenProvider::class, function (Server $c) { + $mapper = $c->query(Authentication\Token\DefaultTokenMapper::class); $crypto = $c->getCrypto(); $config = $c->getConfig(); $logger = $c->getLogger(); $timeFactory = new TimeFactory(); return new \OC\Authentication\Token\DefaultTokenProvider($mapper, $crypto, $config, $logger, $timeFactory); }); - $this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider'); + $this->registerAlias(IProvider::class, Authentication\Token\DefaultTokenProvider::class); $this->registerService(\OCP\IUserSession::class, function (Server $c) { $manager = $c->getUserManager(); @@ -346,7 +349,7 @@ class Server extends ServerContainer implements IServerContainer { // Token providers might require a working database. This code // might however be called when ownCloud is not yet setup. if (\OC::$server->getSystemConfig()->getValue('installed', false)) { - $defaultTokenProvider = $c->query('OC\Authentication\Token\IProvider'); + $defaultTokenProvider = $c->query(IProvider::class); } else { $defaultTokenProvider = null; } @@ -417,7 +420,7 @@ class Server extends ServerContainer implements IServerContainer { $c->getConfig(), $c->getActivityManager(), $c->getLogger(), - $c->query(\OC\Authentication\Token\IProvider::class), + $c->query(IProvider::class), $c->query(ITimeFactory::class), $c->query(EventDispatcherInterface::class) ); @@ -480,9 +483,9 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService(Factory::class, function (Server $c) { $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), - '\\OC\\Memcache\\ArrayCache', - '\\OC\\Memcache\\ArrayCache', - '\\OC\\Memcache\\ArrayCache' + ArrayCache::class, + ArrayCache::class, + ArrayCache::class ); $config = $c->getConfig(); $request = $c->getRequest(); @@ -903,7 +906,7 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { $config = $c->getConfig(); - $factoryClass = $config->getSystemValue('comments.managerFactory', '\OC\Comments\ManagerFactory'); + $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); /** @var \OCP\Comments\ICommentsManagerFactory $factory */ $factory = new $factoryClass($this); $manager = $factory->getManager(); @@ -1020,7 +1023,7 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService(\OCP\Share\IManager::class, function (Server $c) { $config = $c->getConfig(); - $factoryClass = $config->getSystemValue('sharing.managerFactory', '\OC\Share20\ProviderFactory'); + $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); /** @var \OCP\Share\IProviderFactory $factory */ $factory = new $factoryClass($this); |