From: Côme Chilliet Date: Tue, 20 Feb 2024 09:03:53 +0000 (+0100) Subject: chore(files_trashbin): Migrate away from deprecated ILogger X-Git-Tag: v29.0.0beta1~190^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F43671%2Fhead;p=nextcloud-server.git chore(files_trashbin): Migrate away from deprecated ILogger Signed-off-by: Côme Chilliet --- diff --git a/apps/files_trashbin/lib/AppInfo/Application.php b/apps/files_trashbin/lib/AppInfo/Application.php index f83c56a64b0..0f36fe37d29 100644 --- a/apps/files_trashbin/lib/AppInfo/Application.php +++ b/apps/files_trashbin/lib/AppInfo/Application.php @@ -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]); } } }