aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/HookManager.php6
-rw-r--r--apps/dav/tests/unit/CardDAV/ConverterTest.php14
-rw-r--r--apps/dav/tests/unit/DAV/HookManagerTest.php6
-rw-r--r--apps/files_trashbin/lib/Storage.php8
-rw-r--r--apps/files_trashbin/tests/StorageTest.php5
-rw-r--r--apps/twofactor_backupcodes/composer/composer/autoload_classmap.php1
-rw-r--r--apps/twofactor_backupcodes/composer/composer/autoload_static.php1
-rw-r--r--apps/twofactor_backupcodes/lib/AppInfo/Application.php36
-rw-r--r--apps/twofactor_backupcodes/lib/Event/CodesGenerated.php3
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php10
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/ClearNotifications.php9
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/IListener.php33
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php10
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php7
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php8
-rw-r--r--apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php5
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php6
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php2
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php2
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php2
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php2
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php6
22 files changed, 64 insertions, 118 deletions
diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php
index 27b6525be47..272c4cd1ad3 100644
--- a/apps/dav/lib/HookManager.php
+++ b/apps/dav/lib/HookManager.php
@@ -32,7 +32,7 @@ use OCA\DAV\CardDAV\SyncService;
use OCP\IUser;
use OCP\IUserManager;
use OCP\Util;
-use Symfony\Component\EventDispatcher\EventDispatcher;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class HookManager {
@@ -57,14 +57,14 @@ class HookManager {
/** @var array */
private $addressBooksToDelete = [];
- /** @var EventDispatcher */
+ /** @var EventDispatcherInterface */
private $eventDispatcher;
public function __construct(IUserManager $userManager,
SyncService $syncService,
CalDavBackend $calDav,
CardDavBackend $cardDav,
- EventDispatcher $eventDispatcher) {
+ EventDispatcherInterface $eventDispatcher) {
$this->userManager = $userManager;
$this->syncService = $syncService;
$this->calDav = $calDav;
diff --git a/apps/dav/tests/unit/CardDAV/ConverterTest.php b/apps/dav/tests/unit/CardDAV/ConverterTest.php
index 757d69659e8..dbb035a33d3 100644
--- a/apps/dav/tests/unit/CardDAV/ConverterTest.php
+++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php
@@ -32,7 +32,6 @@ use OCP\IDBConnection;
use OCP\IImage;
use OCP\IUser;
use PHPUnit_Framework_MockObject_MockObject;
-use Symfony\Component\EventDispatcher\EventDispatcher;
use Test\TestCase;
class ConverterTest extends TestCase {
@@ -40,19 +39,10 @@ class ConverterTest extends TestCase {
/** @var AccountManager | PHPUnit_Framework_MockObject_MockObject */
private $accountManager;
- /** @var EventDispatcher | PHPUnit_Framework_MockObject_MockObject */
- private $eventDispatcher;
-
- /** @var IDBConnection | PHPUnit_Framework_MockObject_MockObject */
- private $databaseConnection;
-
public function setUp() {
parent::setUp();
- $this->databaseConnection = $this->getMockBuilder(IDBConnection::class)->getMock();
- $this->eventDispatcher = $this->getMockBuilder(EventDispatcher::class)
- ->disableOriginalConstructor()->getMock();
- $this->accountManager = $this->getMockBuilder(AccountManager::class)
- ->disableOriginalConstructor()->getMock();
+
+ $this->accountManager = $this->createMock(AccountManager::class);
}
public function getAccountManager(IUser $user) {
diff --git a/apps/dav/tests/unit/DAV/HookManagerTest.php b/apps/dav/tests/unit/DAV/HookManagerTest.php
index 25219b7a8f2..75baf8257da 100644
--- a/apps/dav/tests/unit/DAV/HookManagerTest.php
+++ b/apps/dav/tests/unit/DAV/HookManagerTest.php
@@ -36,19 +36,19 @@ use OCA\DAV\HookManager;
use OCP\IL10N;
use OCP\IUser;
use OCP\IUserManager;
-use Symfony\Component\EventDispatcher\EventDispatcher;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase;
class HookManagerTest extends TestCase {
/** @var IL10N */
private $l10n;
- /** @var EventDispatcher | \PHPUnit_Framework_MockObject_MockObject */
+ /** @var EventDispatcherInterface | \PHPUnit_Framework_MockObject_MockObject */
private $eventDispatcher;
public function setUp() {
parent::setUp();
- $this->eventDispatcher = $this->getMockBuilder(EventDispatcher::class)->disableOriginalConstructor()->getMock();
+ $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
$this->l10n = $this->createMock(IL10N::class);
$this->l10n
->expects($this->any())
diff --git a/apps/files_trashbin/lib/Storage.php b/apps/files_trashbin/lib/Storage.php
index 0db634eeb9e..04105dda6ce 100644
--- a/apps/files_trashbin/lib/Storage.php
+++ b/apps/files_trashbin/lib/Storage.php
@@ -38,7 +38,7 @@ use OCP\Files\Mount\IMountPoint;
use OCP\Files\Node;
use OCP\ILogger;
use OCP\IUserManager;
-use Symfony\Component\EventDispatcher\EventDispatcher;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class Storage extends Wrapper {
/** @var IMountPoint */
@@ -50,7 +50,7 @@ class Storage extends Wrapper {
/** @var ILogger */
private $logger;
- /** @var EventDispatcher */
+ /** @var EventDispatcherInterface */
private $eventDispatcher;
/** @var IRootFolder */
@@ -66,7 +66,7 @@ class Storage extends Wrapper {
* @param ITrashManager $trashManager
* @param IUserManager|null $userManager
* @param ILogger|null $logger
- * @param EventDispatcher|null $eventDispatcher
+ * @param EventDispatcherInterface|null $eventDispatcher
* @param IRootFolder|null $rootFolder
*/
public function __construct(
@@ -74,7 +74,7 @@ class Storage extends Wrapper {
ITrashManager $trashManager = null,
IUserManager $userManager = null,
ILogger $logger = null,
- EventDispatcher $eventDispatcher = null,
+ EventDispatcherInterface $eventDispatcher = null,
IRootFolder $rootFolder = null
) {
$this->mountPoint = $parameters['mountPoint'];
diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php
index 058d64d1aa0..eff33f9b30c 100644
--- a/apps/files_trashbin/tests/StorageTest.php
+++ b/apps/files_trashbin/tests/StorageTest.php
@@ -40,7 +40,7 @@ use OCP\Files\IRootFolder;
use OCP\Files\Node;
use OCP\ILogger;
use OCP\IUserManager;
-use Symfony\Component\EventDispatcher\EventDispatcher;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Class Storage
@@ -543,8 +543,7 @@ class StorageTest extends \Test\TestCase {
$userManager->expects($this->any())
->method('userExists')->willReturn($userExists);
$logger = $this->getMockBuilder(ILogger::class)->getMock();
- $eventDispatcher = $this->getMockBuilder(EventDispatcher::class)
- ->disableOriginalConstructor()->getMock();
+ $eventDispatcher = $this->createMock(EventDispatcherInterface::class);
$rootFolder = $this->createMock(IRootFolder::class);
$node = $this->getMockBuilder(Node::class)->disableOriginalConstructor()->getMock();
$trashManager = $this->createMock(ITrashManager::class);
diff --git a/apps/twofactor_backupcodes/composer/composer/autoload_classmap.php b/apps/twofactor_backupcodes/composer/composer/autoload_classmap.php
index 2038421a3a2..cf5eae2a5df 100644
--- a/apps/twofactor_backupcodes/composer/composer/autoload_classmap.php
+++ b/apps/twofactor_backupcodes/composer/composer/autoload_classmap.php
@@ -16,7 +16,6 @@ return array(
'OCA\\TwoFactorBackupCodes\\Event\\CodesGenerated' => $baseDir . '/../lib/Event/CodesGenerated.php',
'OCA\\TwoFactorBackupCodes\\Listener\\ActivityPublisher' => $baseDir . '/../lib/Listener/ActivityPublisher.php',
'OCA\\TwoFactorBackupCodes\\Listener\\ClearNotifications' => $baseDir . '/../lib/Listener/ClearNotifications.php',
- 'OCA\\TwoFactorBackupCodes\\Listener\\IListener' => $baseDir . '/../lib/Listener/IListener.php',
'OCA\\TwoFactorBackupCodes\\Listener\\ProviderDisabled' => $baseDir . '/../lib/Listener/ProviderDisabled.php',
'OCA\\TwoFactorBackupCodes\\Listener\\ProviderEnabled' => $baseDir . '/../lib/Listener/ProviderEnabled.php',
'OCA\\TwoFactorBackupCodes\\Listener\\RegistryUpdater' => $baseDir . '/../lib/Listener/RegistryUpdater.php',
diff --git a/apps/twofactor_backupcodes/composer/composer/autoload_static.php b/apps/twofactor_backupcodes/composer/composer/autoload_static.php
index d1f124a407d..3dc21274529 100644
--- a/apps/twofactor_backupcodes/composer/composer/autoload_static.php
+++ b/apps/twofactor_backupcodes/composer/composer/autoload_static.php
@@ -31,7 +31,6 @@ class ComposerStaticInitTwoFactorBackupCodes
'OCA\\TwoFactorBackupCodes\\Event\\CodesGenerated' => __DIR__ . '/..' . '/../lib/Event/CodesGenerated.php',
'OCA\\TwoFactorBackupCodes\\Listener\\ActivityPublisher' => __DIR__ . '/..' . '/../lib/Listener/ActivityPublisher.php',
'OCA\\TwoFactorBackupCodes\\Listener\\ClearNotifications' => __DIR__ . '/..' . '/../lib/Listener/ClearNotifications.php',
- 'OCA\\TwoFactorBackupCodes\\Listener\\IListener' => __DIR__ . '/..' . '/../lib/Listener/IListener.php',
'OCA\\TwoFactorBackupCodes\\Listener\\ProviderDisabled' => __DIR__ . '/..' . '/../lib/Listener/ProviderDisabled.php',
'OCA\\TwoFactorBackupCodes\\Listener\\ProviderEnabled' => __DIR__ . '/..' . '/../lib/Listener/ProviderEnabled.php',
'OCA\\TwoFactorBackupCodes\\Listener\\RegistryUpdater' => __DIR__ . '/..' . '/../lib/Listener/RegistryUpdater.php',
diff --git a/apps/twofactor_backupcodes/lib/AppInfo/Application.php b/apps/twofactor_backupcodes/lib/AppInfo/Application.php
index fc6c94d5b7a..041af037067 100644
--- a/apps/twofactor_backupcodes/lib/AppInfo/Application.php
+++ b/apps/twofactor_backupcodes/lib/AppInfo/Application.php
@@ -29,18 +29,16 @@ use OCA\TwoFactorBackupCodes\Db\BackupCodeMapper;
use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
use OCA\TwoFactorBackupCodes\Listener\ActivityPublisher;
use OCA\TwoFactorBackupCodes\Listener\ClearNotifications;
-use OCA\TwoFactorBackupCodes\Listener\IListener;
use OCA\TwoFactorBackupCodes\Listener\ProviderDisabled;
use OCA\TwoFactorBackupCodes\Listener\ProviderEnabled;
use OCA\TwoFactorBackupCodes\Listener\RegistryUpdater;
use OCA\TwoFactorBackupCodes\Notifications\Notifier;
use OCP\AppFramework\App;
use OCP\Authentication\TwoFactorAuth\IRegistry;
-use OCP\Authentication\TwoFactorAuth\RegistryEvent;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\IL10N;
use OCP\Notification\IManager;
use OCP\Util;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class Application extends App {
public function __construct() {
@@ -62,32 +60,14 @@ class Application extends App {
Util::connectHook('OC_User', 'post_deleteUser', $this, 'deleteUser');
$container = $this->getContainer();
- /** @var EventDispatcherInterface $eventDispatcher */
- $eventDispatcher = $container->query(EventDispatcherInterface::class);
- $eventDispatcher->addListener(CodesGenerated::class, function (CodesGenerated $event) use ($container) {
- /** @var IListener[] $listeners */
- $listeners = [
- $container->query(ActivityPublisher::class),
- $container->query(RegistryUpdater::class),
- $container->query(ClearNotifications::class),
- ];
- foreach ($listeners as $listener) {
- $listener->handle($event);
- }
- });
-
- $eventDispatcher->addListener(IRegistry::EVENT_PROVIDER_ENABLED, function(RegistryEvent $event) use ($container) {
- /** @var IListener $listener */
- $listener = $container->query(ProviderEnabled::class);
- $listener->handle($event);
- });
-
- $eventDispatcher->addListener(IRegistry::EVENT_PROVIDER_DISABLED, function(RegistryEvent $event) use ($container) {
- /** @var IListener $listener */
- $listener = $container->query(ProviderDisabled::class);
- $listener->handle($event);
- });
+ /** @var IEventDispatcher $eventDispatcher */
+ $eventDispatcher = $container->query(IEventDispatcher::class);
+ $eventDispatcher->addServiceListener(CodesGenerated::class, ActivityPublisher::class);
+ $eventDispatcher->addServiceListener(CodesGenerated::class, RegistryUpdater::class);
+ $eventDispatcher->addServiceListener(CodesGenerated::class, ClearNotifications::class);
+ $eventDispatcher->addServiceListener(IRegistry::EVENT_PROVIDER_ENABLED, ProviderEnabled::class);
+ $eventDispatcher->addServiceListener(IRegistry::EVENT_PROVIDER_DISABLED, ProviderDisabled::class);
}
public function registerNotification() {
diff --git a/apps/twofactor_backupcodes/lib/Event/CodesGenerated.php b/apps/twofactor_backupcodes/lib/Event/CodesGenerated.php
index c4ffcb37601..1724053281b 100644
--- a/apps/twofactor_backupcodes/lib/Event/CodesGenerated.php
+++ b/apps/twofactor_backupcodes/lib/Event/CodesGenerated.php
@@ -24,8 +24,8 @@ declare(strict_types=1);
namespace OCA\TwoFactorBackupCodes\Event;
+use OCP\EventDispatcher\Event;
use OCP\IUser;
-use Symfony\Component\EventDispatcher\Event;
class CodesGenerated extends Event {
@@ -33,6 +33,7 @@ class CodesGenerated extends Event {
private $user;
public function __construct(IUser $user) {
+ parent::__construct();
$this->user = $user;
}
diff --git a/apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php b/apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php
index 31e2ac6e508..75a5937b5fa 100644
--- a/apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php
+++ b/apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php
@@ -27,10 +27,11 @@ namespace OCA\TwoFactorBackupCodes\Listener;
use BadMethodCallException;
use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
use OCP\Activity\IManager;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
use OCP\ILogger;
-use Symfony\Component\EventDispatcher\Event;
-class ActivityPublisher implements IListener {
+class ActivityPublisher implements IEventListener {
/** @var IManager */
private $activityManager;
@@ -38,7 +39,8 @@ class ActivityPublisher implements IListener {
/** @var ILogger */
private $logger;
- public function __construct(IManager $activityManager, ILogger $logger) {
+ public function __construct(IManager $activityManager,
+ ILogger $logger) {
$this->activityManager = $activityManager;
$this->logger = $logger;
}
@@ -46,7 +48,7 @@ class ActivityPublisher implements IListener {
/**
* Push an event to the user's activity stream
*/
- public function handle(Event $event) {
+ public function handle(Event $event): void {
if ($event instanceof CodesGenerated) {
$activity = $this->activityManager->generateEvent();
$activity->setApp('twofactor_backupcodes')
diff --git a/apps/twofactor_backupcodes/lib/Listener/ClearNotifications.php b/apps/twofactor_backupcodes/lib/Listener/ClearNotifications.php
index ad7fd188ebc..eb0f7363aab 100644
--- a/apps/twofactor_backupcodes/lib/Listener/ClearNotifications.php
+++ b/apps/twofactor_backupcodes/lib/Listener/ClearNotifications.php
@@ -1,5 +1,7 @@
<?php
+
declare(strict_types=1);
+
/**
* @copyright Copyright (c) 2018, Roeland Jago Douma <roeland@famdouma.nl>
*
@@ -25,10 +27,11 @@ declare(strict_types=1);
namespace OCA\TwoFactorBackupCodes\Listener;
use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
use OCP\Notification\IManager;
-use Symfony\Component\EventDispatcher\Event;
-class ClearNotifications implements IListener {
+class ClearNotifications implements IEventListener {
/** @var IManager */
private $manager;
@@ -37,7 +40,7 @@ class ClearNotifications implements IListener {
$this->manager = $manager;
}
- public function handle(Event $event) {
+ public function handle(Event $event): void {
if (!($event instanceof CodesGenerated)) {
return;
}
diff --git a/apps/twofactor_backupcodes/lib/Listener/IListener.php b/apps/twofactor_backupcodes/lib/Listener/IListener.php
deleted file mode 100644
index ec45de5c075..00000000000
--- a/apps/twofactor_backupcodes/lib/Listener/IListener.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-namespace OCA\TwoFactorBackupCodes\Listener;
-
-use Symfony\Component\EventDispatcher\Event;
-
-interface IListener {
-
- public function handle(Event $event);
-
-}
diff --git a/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php b/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php
index 835eb0394f9..bf2899f391f 100644
--- a/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php
+++ b/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php
@@ -1,5 +1,7 @@
<?php
+
declare(strict_types=1);
+
/**
* @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
*
@@ -22,16 +24,16 @@ declare(strict_types=1);
*
*/
-
namespace OCA\TwoFactorBackupCodes\Listener;
use OCA\TwoFactorBackupCodes\BackgroundJob\RememberBackupCodesJob;
use OCP\Authentication\TwoFactorAuth\IRegistry;
use OCP\Authentication\TwoFactorAuth\RegistryEvent;
use OCP\BackgroundJob\IJobList;
-use Symfony\Component\EventDispatcher\Event;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
-class ProviderDisabled implements IListener {
+class ProviderDisabled implements IEventListener {
/** @var IRegistry */
private $registry;
@@ -45,7 +47,7 @@ class ProviderDisabled implements IListener {
$this->jobList = $jobList;
}
- public function handle(Event $event) {
+ public function handle(Event $event): void {
if (!($event instanceof RegistryEvent)) {
return;
}
diff --git a/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php b/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php
index 48cbef66f1b..7c258213384 100644
--- a/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php
+++ b/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php
@@ -28,9 +28,10 @@ use OCA\TwoFactorBackupCodes\BackgroundJob\RememberBackupCodesJob;
use OCP\Authentication\TwoFactorAuth\IRegistry;
use OCP\Authentication\TwoFactorAuth\RegistryEvent;
use OCP\BackgroundJob\IJobList;
-use Symfony\Component\EventDispatcher\Event;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
-class ProviderEnabled implements IListener {
+class ProviderEnabled implements IEventListener {
/** @var IRegistry */
private $registry;
@@ -44,7 +45,7 @@ class ProviderEnabled implements IListener {
$this->jobList = $jobList;
}
- public function handle(Event $event) {
+ public function handle(Event $event): void {
if (!($event instanceof RegistryEvent)) {
return;
}
diff --git a/apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php b/apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php
index 95b0db090ee..93e4959b24b 100644
--- a/apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php
+++ b/apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php
@@ -27,9 +27,10 @@ namespace OCA\TwoFactorBackupCodes\Listener;
use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider;
use OCP\Authentication\TwoFactorAuth\IRegistry;
-use Symfony\Component\EventDispatcher\Event;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
-class RegistryUpdater implements IListener {
+class RegistryUpdater implements IEventListener {
/** @var IRegistry */
private $registry;
@@ -42,9 +43,10 @@ class RegistryUpdater implements IListener {
$this->provider = $provider;
}
- public function handle(Event $event) {
+ public function handle(Event $event): void {
if ($event instanceof CodesGenerated) {
$this->registry->enableProviderFor($this->provider, $event->getUser());
}
}
+
}
diff --git a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
index 74a032dcc0a..88117c37ec0 100644
--- a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
+++ b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
@@ -27,6 +27,7 @@ use OCA\TwoFactorBackupCodes\Db\BackupCode;
use OCA\TwoFactorBackupCodes\Db\BackupCodeMapper;
use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
use OCP\Activity\IManager;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\ILogger;
use OCP\IUser;
use OCP\Security\IHasher;
@@ -46,13 +47,13 @@ class BackupCodeStorage {
/** @var ISecureRandom */
private $random;
- /** @var EventDispatcherInterface */
+ /** @var IEventDispatcher */
private $eventDispatcher;
public function __construct(BackupCodeMapper $mapper,
ISecureRandom $random,
IHasher $hasher,
- EventDispatcherInterface $eventDispatcher) {
+ IEventDispatcher $eventDispatcher) {
$this->mapper = $mapper;
$this->hasher = $hasher;
$this->random = $random;
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
index a6c38701a30..44ea88cdb0b 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
@@ -28,15 +28,15 @@ use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
use OCA\TwoFactorBackupCodes\Listener\ActivityPublisher;
use OCP\Activity\IEvent;
use OCP\Activity\IManager;
+use OCP\EventDispatcher\Event;
use OCP\ILogger;
use OCP\IUser;
-use PHPUnit_Framework_MockObject_MockObject;
-use Symfony\Component\EventDispatcher\Event;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class ActivityPublisherTest extends TestCase {
- /** @var IManager|PHPUnit_Framework_MockObject_MockObject */
+ /** @var IManager|MockObject */
private $activityManager;
/** @var ILogger */
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php
index 123c008cbbb..21dde19d329 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php
@@ -26,10 +26,10 @@ namespace OCA\TwoFactorBackupCodes\Tests\Unit\Listener;
use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
use OCA\TwoFactorBackupCodes\Listener\ClearNotifications;
+use OCP\EventDispatcher\Event;
use OCP\IUser;
use OCP\Notification\IManager;
use OCP\Notification\INotification;
-use Symfony\Component\EventDispatcher\Event;
use Test\TestCase;
class ClearNotificationsTest extends TestCase {
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php
index 1bd5a7ccab0..39df7a417f6 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php
@@ -30,8 +30,8 @@ use OCA\TwoFactorBackupCodes\Listener\ProviderDisabled;
use OCP\Authentication\TwoFactorAuth\IRegistry;
use OCP\Authentication\TwoFactorAuth\RegistryEvent;
use OCP\BackgroundJob\IJobList;
+use OCP\EventDispatcher\Event;
use OCP\IUser;
-use Symfony\Component\EventDispatcher\Event;
use Test\TestCase;
class ProviderDisabledTest extends TestCase {
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php
index c824ad8e87a..8a4ce56d7cb 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php
@@ -29,8 +29,8 @@ use OCA\TwoFactorBackupCodes\Listener\ProviderEnabled;
use OCP\Authentication\TwoFactorAuth\IRegistry;
use OCP\Authentication\TwoFactorAuth\RegistryEvent;
use OCP\BackgroundJob\IJobList;
+use OCP\EventDispatcher\Event;
use OCP\IUser;
-use Symfony\Component\EventDispatcher\Event;
use Test\TestCase;
class ProviderEnabledTest extends TestCase {
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php
index 2e75804661b..7ae6eab3358 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php
@@ -28,8 +28,8 @@ use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
use OCA\TwoFactorBackupCodes\Listener\RegistryUpdater;
use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider;
use OCP\Authentication\TwoFactorAuth\IRegistry;
+use OCP\EventDispatcher\Event;
use OCP\IUser;
-use Symfony\Component\EventDispatcher\Event;
use Test\TestCase;
class RegistryUpdaterTest extends TestCase {
diff --git a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
index 2aa323a0a73..d962961c251 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
@@ -26,11 +26,11 @@ use OCA\TwoFactorBackupCodes\Db\BackupCode;
use OCA\TwoFactorBackupCodes\Db\BackupCodeMapper;
use OCA\TwoFactorBackupCodes\Event\CodesGenerated;
use OCA\TwoFactorBackupCodes\Service\BackupCodeStorage;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\IUser;
use OCP\Security\IHasher;
use OCP\Security\ISecureRandom;
use PHPUnit_Framework_MockObject_MockObject;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase;
class BackupCodeStorageTest extends TestCase {
@@ -44,7 +44,7 @@ class BackupCodeStorageTest extends TestCase {
/** @var IHasher|PHPUnit_Framework_MockObject_MockObject */
private $hasher;
- /** @var EventDispatcherInterface|PHPUnit_Framework_MockObject_MockObject */
+ /** @var IEventDispatcher|PHPUnit_Framework_MockObject_MockObject */
private $eventDispatcher;
/** @var BackupCodeStorage */
@@ -56,7 +56,7 @@ class BackupCodeStorageTest extends TestCase {
$this->mapper = $this->createMock(BackupCodeMapper::class);
$this->random = $this->createMock(ISecureRandom::class);
$this->hasher = $this->createMock(IHasher::class);
- $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
+ $this->eventDispatcher = $this->createMock(IEventDispatcher::class);
$this->storage = new BackupCodeStorage($this->mapper, $this->random, $this->hasher, $this->eventDispatcher);
}