]> source.dussan.org Git - nextcloud-server.git/commitdiff
chore(files_trashbin): Migrate away from deprecated ILogger 43671/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 20 Feb 2024 09:03:53 +0000 (10:03 +0100)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 20 Feb 2024 09:03:53 +0000 (10:03 +0100)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/files_trashbin/lib/AppInfo/Application.php

index f83c56a64b0899c204355859a93501a9f64ed58b..0f36fe37d29f8e880da1e9dcc58ef6d84468ae93 100644 (file)
@@ -38,8 +38,8 @@ use OCP\AppFramework\App;
 use OCP\AppFramework\Bootstrap\IBootContext;
 use OCP\AppFramework\Bootstrap\IBootstrap;
 use OCP\AppFramework\Bootstrap\IRegistrationContext;
-use OCP\ILogger;
-use OCP\IServerContainer;
+use Psr\Container\ContainerInterface;
+use Psr\Log\LoggerInterface;
 
 class Application extends App implements IBootstrap {
        public const APP_ID = 'files_trashbin';
@@ -77,7 +77,7 @@ class Application extends App implements IBootstrap {
                \OCP\Util::connectHook('OC_Filesystem', 'delete', 'OCA\Files_Trashbin\Trashbin', 'ensureFileScannedHook');
        }
 
-       public function registerTrashBackends(IServerContainer $serverContainer, ILogger $logger, IAppManager $appManager, ITrashManager $trashManager) {
+       public function registerTrashBackends(ContainerInterface $serverContainer, LoggerInterface $logger, IAppManager $appManager, ITrashManager $trashManager): void {
                foreach ($appManager->getInstalledApps() as $app) {
                        $appInfo = $appManager->getAppInfo($app);
                        if (isset($appInfo['trash'])) {
@@ -87,10 +87,10 @@ class Application extends App implements IBootstrap {
                                        $for = $backend['@attributes']['for'];
 
                                        try {
-                                               $backendObject = $serverContainer->query($class);
+                                               $backendObject = $serverContainer->get($class);
                                                $trashManager->registerBackend($for, $backendObject);
                                        } catch (\Exception $e) {
-                                               $logger->logException($e);
+                                               $logger->error($e->getMessage(), ['exception' => $e]);
                                        }
                                }
                        }