@@ -44,23 +44,23 @@ |
||
| 44 | 44 | use OCP\User\Events\UserDeletedEvent; |
| 45 | 45 | |
| 46 | 46 | class Application extends App implements IBootstrap { |
| 47 | - public const APP_ID = 'twofactor_backupcodes'; |
|
| 47 | + public const APP_ID = 'twofactor_backupcodes'; |
|
| 48 | 48 | |
| 49 | - public function __construct() { |
|
| 50 | - parent::__construct(self::APP_ID); |
|
| 51 | - } |
|
| 49 | + public function __construct() { |
|
| 50 | + parent::__construct(self::APP_ID); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - public function register(IRegistrationContext $context): void { |
|
| 54 | - $context->registerNotifierService(Notifier::class); |
|
| 53 | + public function register(IRegistrationContext $context): void { |
|
| 54 | + $context->registerNotifierService(Notifier::class); |
|
| 55 | 55 | |
| 56 | - $context->registerEventListener(CodesGenerated::class, ActivityPublisher::class); |
|
| 57 | - $context->registerEventListener(CodesGenerated::class, RegistryUpdater::class); |
|
| 58 | - $context->registerEventListener(CodesGenerated::class, ClearNotifications::class); |
|
| 59 | - $context->registerEventListener(IRegistry::EVENT_PROVIDER_ENABLED, ProviderEnabled::class); |
|
| 60 | - $context->registerEventListener(IRegistry::EVENT_PROVIDER_DISABLED, ProviderDisabled::class); |
|
| 61 | - $context->registerEventListener(UserDeletedEvent::class, UserDeleted::class); |
|
| 62 | - } |
|
| 56 | + $context->registerEventListener(CodesGenerated::class, ActivityPublisher::class); |
|
| 57 | + $context->registerEventListener(CodesGenerated::class, RegistryUpdater::class); |
|
| 58 | + $context->registerEventListener(CodesGenerated::class, ClearNotifications::class); |
|
| 59 | + $context->registerEventListener(IRegistry::EVENT_PROVIDER_ENABLED, ProviderEnabled::class); |
|
| 60 | + $context->registerEventListener(IRegistry::EVENT_PROVIDER_DISABLED, ProviderDisabled::class); |
|
| 61 | + $context->registerEventListener(UserDeletedEvent::class, UserDeleted::class); |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - public function boot(IBootContext $context): void { |
|
| 65 | - } |
|
| 64 | + public function boot(IBootContext $context): void { |
|
| 65 | + } |
|
| 66 | 66 | } |
@@ -33,18 +33,18 @@ |
||
| 33 | 33 | |
| 34 | 34 | class UserDeleted implements IEventListener { |
| 35 | 35 | |
| 36 | - /** @var BackupCodeMapper */ |
|
| 37 | - private $backupCodeMapper; |
|
| 36 | + /** @var BackupCodeMapper */ |
|
| 37 | + private $backupCodeMapper; |
|
| 38 | 38 | |
| 39 | - public function __construct(BackupCodeMapper $backupCodeMapper) { |
|
| 40 | - $this->backupCodeMapper = $backupCodeMapper; |
|
| 41 | - } |
|
| 39 | + public function __construct(BackupCodeMapper $backupCodeMapper) { |
|
| 40 | + $this->backupCodeMapper = $backupCodeMapper; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public function handle(Event $event): void { |
|
| 44 | - if (!($event instanceof UserDeletedEvent)) { |
|
| 45 | - return; |
|
| 46 | - } |
|
| 43 | + public function handle(Event $event): void { |
|
| 44 | + if (!($event instanceof UserDeletedEvent)) { |
|
| 45 | + return; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - $this->backupCodeMapper->deleteCodes($event->getUser()); |
|
| 49 | - } |
|
| 48 | + $this->backupCodeMapper->deleteCodes($event->getUser()); |
|
| 49 | + } |
|
| 50 | 50 | } |