1<?php
2
3namespace dokuwiki\plugin\swarmwebhook\webhooks;
4
5abstract class AbstractWebhook
6{
7    abstract public function run($json);
8
9    /**
10     * @return AbstractWebhook
11     */
12    public static function getWebhook()
13    {
14        global $INPUT;
15
16        if ($INPUT->server->str('HTTP_USER_AGENT') === 'Zapier') {
17            return new Zapier();
18        }
19
20        // TODO: we currently have no positive key for IFTTT. Find one.
21        // That would be better than just having it as default.
22        return new IFTTT();
23    }
24}
25