mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-07 15:25:00 +00:00
notification: fix NotificationHandlerInterface
This commit is contained in:
@@ -32,10 +32,10 @@ final class NotificationHandlerManager
|
||||
/**
|
||||
* @throw NotificationHandlerNotFound if handler is not found
|
||||
*/
|
||||
public function getHandler(Notification $notification): NotificationHandlerInterface
|
||||
public function getHandler(Notification $notification, array $options = []): NotificationHandlerInterface
|
||||
{
|
||||
foreach ($this->handlers as $renderer) {
|
||||
if ($renderer->supports($notification)) {
|
||||
if ($renderer->supports($notification, $options)) {
|
||||
return $renderer;
|
||||
}
|
||||
}
|
||||
@@ -43,13 +43,13 @@ final class NotificationHandlerManager
|
||||
throw new NotificationHandlerNotFound();
|
||||
}
|
||||
|
||||
public function getTemplate(Notification $notification): string
|
||||
public function getTemplate(Notification $notification, array $options = []): string
|
||||
{
|
||||
return $this->getHandler($notification)->getTemplate();
|
||||
return $this->getHandler($notification, $options)->getTemplate($options);
|
||||
}
|
||||
|
||||
public function getTemplateData(Notification $notification): array
|
||||
public function getTemplateData(Notification $notification, array $options = []): array
|
||||
{
|
||||
return $this->getHandler($notification)->getTemplateData($notification);
|
||||
return $this->getHandler($notification, $options)->getTemplateData($notification, $options);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user