| Total Complexity | 2 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | class ChannelDriverFactory |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Create a driver instance for the given channel type |
||
| 16 | */ |
||
| 17 | public function create(string $channelType): ?ChannelDriverInterface |
||
| 18 | { |
||
| 19 | return match ($channelType) { |
||
| 20 | 'email' => new EmailDriver(), |
||
| 21 | 'slack' => new SlackDriver(), |
||
| 22 | 'sms' => new SmsDriver(), |
||
| 23 | 'push' => new PushDriver(), |
||
| 24 | 'discord' => new DiscordDriver(), |
||
| 25 | default => null, |
||
| 26 | }; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Get all supported channel types |
||
| 31 | */ |
||
| 32 | public function getSupportedTypes(): array |
||
| 35 | } |
||
| 36 | } |
||
| 39 |