*/ class ClearNotifications implements IEventListener { public function __construct( private IManager $manager, ) { } public function handle(Event $event): void { if (!($event instanceof CodesGenerated)) { return; } $notification = $this->manager->createNotification(); $notification->setApp('twofactor_backupcodes') ->setUser($event->getUser()->getUID()) ->setObject('create', 'codes'); $this->manager->markProcessed($notification); } }