Lint PHP code psr-12, add GH action

This commit is contained in:
Julien Nahum
2024-02-23 11:54:12 +01:00
parent e85e4df7fe
commit 62971a2ef4
226 changed files with 2338 additions and 2144 deletions

View File

@@ -6,10 +6,13 @@ use App\Models\Forms\Form;
class WebhookHandlerProvider
{
const SLACK_PROVIDER = 'slack';
const DISCORD_PROVIDER = 'discord';
const SIMPLE_WEBHOOK_PROVIDER = 'webhook';
const ZAPIER_PROVIDER = 'zapier';
public const SLACK_PROVIDER = 'slack';
public const DISCORD_PROVIDER = 'discord';
public const SIMPLE_WEBHOOK_PROVIDER = 'webhook';
public const ZAPIER_PROVIDER = 'zapier';
public static function getProvider(Form $form, array $data, string $provider, ?string $webhookUrl = null)
{
@@ -24,6 +27,7 @@ class WebhookHandlerProvider
if (is_null($webhookUrl)) {
throw new \Exception('Zapier webhook url is required');
}
return new ZapierHandler($form, $data, $webhookUrl);
default:
throw new \Exception('Unknown webhook provider');