mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
39 lines
1.6 KiB
PHP
39 lines
1.6 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Config;
|
||
|
|
|
||
|
|
use Symfony\Component\Notifier\Bridge\Discord\DiscordTransportFactory;
|
||
|
|
use Symfony\Component\Notifier\Bridge\GoogleChat\GoogleChatTransportFactory;
|
||
|
|
use Symfony\Component\Notifier\Bridge\Mattermost\MattermostTransportFactory;
|
||
|
|
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\MicrosoftTeamsTransportFactory;
|
||
|
|
use Symfony\Component\Notifier\Bridge\RocketChat\RocketChatTransportFactory;
|
||
|
|
use Symfony\Component\Notifier\Bridge\Slack\SlackTransportFactory;
|
||
|
|
use Symfony\Component\Notifier\Bridge\Telegram\TelegramTransportFactory;
|
||
|
|
use Symfony\Component\Notifier\Bridge\Zulip\ZulipTransportFactory;
|
||
|
|
|
||
|
|
enum WebhookScheme: string
|
||
|
|
{
|
||
|
|
case DISCORD = 'discord';
|
||
|
|
case GOOGLE_CHAT = 'googlechat';
|
||
|
|
case MATTERMOST = 'mattermost';
|
||
|
|
case MICROSOFT_TEAMS = 'microsoftteams';
|
||
|
|
case ROCKET_CHAT = 'rocketchat';
|
||
|
|
case SLACK = 'slack';
|
||
|
|
case TELEGRAM = 'telegram';
|
||
|
|
case ZULIP = 'zulip';
|
||
|
|
|
||
|
|
public function getChatTransportFactory(): string
|
||
|
|
{
|
||
|
|
return match ($this) {
|
||
|
|
WebhookScheme::DISCORD => DiscordTransportFactory::class,
|
||
|
|
WebhookScheme::GOOGLE_CHAT => GoogleChatTransportFactory::class,
|
||
|
|
WebhookScheme::MATTERMOST => MattermostTransportFactory::class,
|
||
|
|
WebhookScheme::MICROSOFT_TEAMS => MicrosoftTeamsTransportFactory::class,
|
||
|
|
WebhookScheme::ROCKET_CHAT => RocketChatTransportFactory::class,
|
||
|
|
WebhookScheme::SLACK => SlackTransportFactory::class,
|
||
|
|
WebhookScheme::TELEGRAM => TelegramTransportFactory::class,
|
||
|
|
WebhookScheme::ZULIP => ZulipTransportFactory::class
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|