mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: webhook_dsn can be an empty array
This commit is contained in:
@@ -157,8 +157,9 @@ class WatchListController extends AbstractController
|
|||||||
|
|
||||||
private function verifyWebhookDSN(WatchList $watchList): void
|
private function verifyWebhookDSN(WatchList $watchList): void
|
||||||
{
|
{
|
||||||
if (null !== $watchList->getWebhookDsn()) {
|
$webhookDsn = $watchList->getWebhookDsn();
|
||||||
foreach ($watchList->getWebhookDsn() as $dsnString) {
|
if (null !== $webhookDsn && 0 !== count($webhookDsn)) {
|
||||||
|
foreach ($webhookDsn as $dsnString) {
|
||||||
try {
|
try {
|
||||||
$dsn = new Dsn($dsnString);
|
$dsn = new Dsn($dsnString);
|
||||||
} catch (InvalidArgumentException $exception) {
|
} catch (InvalidArgumentException $exception) {
|
||||||
|
|||||||
@@ -133,8 +133,9 @@ final readonly class ProcessDomainTriggerHandler
|
|||||||
*/
|
*/
|
||||||
private function sendChatNotification(WatchList $watchList, ChatNotificationInterface $notification): void
|
private function sendChatNotification(WatchList $watchList, ChatNotificationInterface $notification): void
|
||||||
{
|
{
|
||||||
if (null !== $watchList->getWebhookDsn()) {
|
$webhookDsn = $watchList->getWebhookDsn();
|
||||||
foreach ($watchList->getWebhookDsn() as $dsnString) {
|
if (null !== $webhookDsn && 0 !== count($webhookDsn)) {
|
||||||
|
foreach ($webhookDsn as $dsnString) {
|
||||||
$dsn = new Dsn($dsnString);
|
$dsn = new Dsn($dsnString);
|
||||||
|
|
||||||
$scheme = $dsn->getScheme();
|
$scheme = $dsn->getScheme();
|
||||||
|
|||||||
Reference in New Issue
Block a user