$container = $this->getContainer();
/** @var IManager $manager */
$manager = $container->query(IManager::class);
- $manager->registerNotifier(
- function() use ($container) {
- return $container->query(Notifier::class);
- },
- function () use ($container) {
- $l = $container->query(IL10N::class);
- return ['id' => 'twofactor_backupcodes', 'name' => $l->t('Second-factor backup codes')];
- }
- );
+ $manager->registerNotifier(Notifier::class);
}
public function deleteUser($params) {
$this->url = $url;
}
- public function prepare(INotification $notification, $languageCode) {
+ /**
+ * Identifier of the notifier, only use [a-z0-9_]
+ *
+ * @return string
+ * @since 17.0.0
+ */
+ public function getID(): string {
+ return 'twofactor_backupcodes';
+ }
+
+ /**
+ * Human readable name describing the notifier
+ *
+ * @return string
+ * @since 17.0.0
+ */
+ public function getName(): string {
+ return $this->factory->get('twofactor_backupcodes')->t('Second-factor backup codes');
+ }
+
+ public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getApp() !== 'twofactor_backupcodes') {
// Not my app => throw
throw new \InvalidArgumentException();
throw new \InvalidArgumentException();
}
}
-
}