From ba27643d27baebb07294031ac27b6b01f2b12dc4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Tue, 20 Feb 2024 10:03:53 +0100 Subject: [PATCH] chore(files_trashbin): Migrate away from deprecated ILogger MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/files_trashbin/lib/AppInfo/Application.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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]); } } } -- 2.39.5