From 1944d9b3abb5f3f20fa5e2ba2004dbd7994bb13f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Sep 2016 01:15:24 +0200 Subject: Use magic DI --- apps/dav/appinfo/app.php | 5 +++-- apps/dav/appinfo/register_command.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'apps/dav/appinfo') diff --git a/apps/dav/appinfo/app.php b/apps/dav/appinfo/app.php index ebc1d09e3f1..0d417fd3fed 100644 --- a/apps/dav/appinfo/app.php +++ b/apps/dav/appinfo/app.php @@ -23,6 +23,7 @@ */ use OCA\DAV\AppInfo\Application; +use OCA\DAV\CardDAV\CardDavBackend; use Symfony\Component\EventDispatcher\GenericEvent; $app = new Application(); @@ -36,8 +37,8 @@ $eventDispatcher = \OC::$server->getEventDispatcher(); $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove', function(GenericEvent $event) use ($app) { - /** @var \OCA\DAV\CardDAV\CardDavBackend $cardDavBackend */ - $cardDavBackend = $app->getContainer()->query('CardDavBackend'); + /** @var CardDavBackend $cardDavBackend */ + $cardDavBackend = $app->getContainer()->query(CardDavBackend::class); $addressBookUri = $event->getSubject(); $addressBook = $cardDavBackend->getAddressBooksByUri('principals/system/system', $addressBookUri); if (!is_null($addressBook)) { diff --git a/apps/dav/appinfo/register_command.php b/apps/dav/appinfo/register_command.php index 7595c1b8335..57bf8ff5dd9 100644 --- a/apps/dav/appinfo/register_command.php +++ b/apps/dav/appinfo/register_command.php @@ -34,6 +34,6 @@ $app = new Application(); /** @var Symfony\Component\Console\Application $application */ $application->add(new CreateCalendar($userManager, $groupManager, $dbConnection)); -$application->add(new CreateAddressBook($userManager, $app->getContainer()->query('CardDavBackend'))); +$application->add(new CreateAddressBook($userManager, $app->getContainer()->query(\OCA\DAV\CardDAV\CardDavBackend::class))); $application->add(new SyncSystemAddressBook($app->getSyncService())); -$application->add(new SyncBirthdayCalendar($userManager, $app->getContainer()->query('BirthdayService'))); +$application->add(new SyncBirthdayCalendar($userManager, $app->getContainer()->query(\OCA\DAV\CalDAV\BirthdayService::class))); -- cgit v1.2.3