Skip to content

Commit

Permalink
chore(files_trashbin): Migrate away from deprecated ILogger
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Feb 20, 2024
1 parent f1fe3be commit ba27643
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/files_trashbin/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
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';
Expand Down Expand Up @@ -77,7 +77,7 @@ public function boot(IBootContext $context): void {
\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'])) {
Expand All @@ -87,10 +87,10 @@ public function registerTrashBackends(IServerContainer $serverContainer, ILogger
$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]);
}
}
}
Expand Down

0 comments on commit ba27643

Please sign in to comment.