diff --git a/discord_webform_handler.info.yml b/discord_webform_handler.info.yml index 8605b95..3067477 100644 --- a/discord_webform_handler.info.yml +++ b/discord_webform_handler.info.yml @@ -4,4 +4,4 @@ package: Webform core_version_requirement: '^9 || ^10' type: module dependencies: - - webform \ No newline at end of file + - webform:webform diff --git a/discord_webform_handler.module b/discord_webform_handler.module index 5c15a99..9b4055a 100644 --- a/discord_webform_handler.module +++ b/discord_webform_handler.module @@ -1 +1,6 @@ -<?php \ No newline at end of file +<?php + +/** + * @file + * Hooks implementation for the Discord Webform Handler module. + */ diff --git a/src/Plugin/WebformHandler/DiscordWebformHandler.php b/src/Plugin/WebformHandler/DiscordWebformHandler.php index 4a3e537..31dffc1 100644 --- a/src/Plugin/WebformHandler/DiscordWebformHandler.php +++ b/src/Plugin/WebformHandler/DiscordWebformHandler.php @@ -1,4 +1,5 @@ <?php + namespace Drupal\discord_webform_handler\Plugin\WebformHandler; use Drupal\Core\Form\FormStateInterface; @@ -18,6 +19,7 @@ use Drupal\webform\WebformSubmissionInterface; * ) */ class DiscordWebformHandler extends WebformHandlerBase { + /** * {@inheritdoc} */ @@ -56,14 +58,15 @@ class DiscordWebformHandler extends WebformHandlerBase { $client = \Drupal::httpClient(); $webhook_url = $this->configuration['webhook_url']; try { - $response = $client->post($webhook_url, [ + $client->post($webhook_url, [ 'json' => [ 'content' => json_encode($data), ], ]); - } catch (RequestException $e) { + } + catch (RequestException $e) { watchdog_exception('webform_discord_webhook', $e); } } -} \ No newline at end of file +}