summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/AppInfo
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-07-14 14:48:23 +0200
committerCarl Schwan <carl@carlschwan.eu>2021-07-23 10:07:38 +0200
commit701b57b81d698a4933d9d04aa1aff85734816dfa (patch)
tree6818c1eb7e076a27b4cd04316eb2511a2deeed3a /apps/files_versions/lib/AppInfo
parent5579aaa7cb18b8d4832d831c20d70fb4d5189e66 (diff)
downloadnextcloud-server-701b57b81d698a4933d9d04aa1aff85734816dfa.tar.gz
nextcloud-server-701b57b81d698a4933d9d04aa1aff85734816dfa.zip
Remove allmost all deprecation from the files_version app
The remaining deprecations are related to Utils::hooks and I will take a look at how EventDispatcher works before working on them. Aside from the deprecations, this patch also does a few minor improvements around type hinting. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/files_versions/lib/AppInfo')
-rw-r--r--apps/files_versions/lib/AppInfo/Application.php25
1 files changed, 15 insertions, 10 deletions
diff --git a/apps/files_versions/lib/AppInfo/Application.php b/apps/files_versions/lib/AppInfo/Application.php
index ad38c017498..f0d182043c1 100644
--- a/apps/files_versions/lib/AppInfo/Application.php
+++ b/apps/files_versions/lib/AppInfo/Application.php
@@ -43,9 +43,14 @@ use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
-use OCP\ILogger;
+use OCP\IConfig;
+use OCP\IGroupManager;
use OCP\IServerContainer;
+use OCP\IUserManager;
+use OCP\IUserSession;
+use OCP\Share\IManager as IShareManager;
use Psr\Container\ContainerInterface;
+use Psr\Log\LoggerInterface;
class Application extends App implements IBootstrap {
public const APP_ID = 'files_versions';
@@ -67,14 +72,14 @@ class Application extends App implements IBootstrap {
/** @var IServerContainer $server */
$server = $c->get(IServerContainer::class);
return new Principal(
- $server->getUserManager(),
- $server->getGroupManager(),
- $server->getShareManager(),
- $server->getUserSession(),
- $server->getAppManager(),
+ $server->get(IUserManager::class),
+ $server->get(IGroupManager::class),
+ $server->get(IShareManager::class),
+ $server->get(IUserSession::class),
+ $server->get(IAppManager::class),
$server->get(ProxyMapper::class),
$server->get(KnownUserService::class),
- $server->getConfig()
+ $server->get(IConfig::class)
);
});
@@ -98,7 +103,7 @@ class Application extends App implements IBootstrap {
Hooks::connectHooks();
}
- public function registerVersionBackends(ContainerInterface $container, IAppManager $appManager, ILogger $logger) {
+ public function registerVersionBackends(ContainerInterface $container, IAppManager $appManager, LoggerInterface $logger): void {
foreach ($appManager->getInstalledApps() as $app) {
$appInfo = $appManager->getAppInfo($app);
if (isset($appInfo['versions'])) {
@@ -116,7 +121,7 @@ class Application extends App implements IBootstrap {
}
}
- private function loadBackend(array $backend, ContainerInterface $container, ILogger $logger) {
+ private function loadBackend(array $backend, ContainerInterface $container, LoggerInterface $logger): void {
/** @var IVersionManager $versionManager */
$versionManager = $container->get(IVersionManager::class);
$class = $backend['@value'];
@@ -125,7 +130,7 @@ class Application extends App implements IBootstrap {
$backendObject = $container->get($class);
$versionManager->registerBackend($for, $backendObject);
} catch (\Exception $e) {
- $logger->logException($e);
+ $logger->error($e->getMessage(), ['exception' => $e]);
}
}
}