1 | <?php |
||
9 | class LegacyUrlPlugin implements EventSubscriberInterface |
||
10 | { |
||
11 | const BASE_URL = '%s.slack.com'; |
||
12 | const WEBHOOK_PATH = '/services/hooks/incoming-webhook'; |
||
13 | |||
14 | private $username; |
||
15 | private $token; |
||
16 | |||
17 | /** |
||
18 | * @param $username |
||
19 | * @param $token |
||
20 | */ |
||
21 | 6 | public function __construct($username, $token) |
|
26 | |||
27 | /** |
||
28 | * @see EventSubscriberInterface |
||
29 | */ |
||
30 | 3 | public static function getSubscribedEvents() |
|
31 | { |
||
32 | return [ |
||
33 | 3 | 'request.before_send' => ['onRequestBeforeSend', -1000], |
|
34 | 3 | ]; |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param Event $e |
||
39 | */ |
||
40 | 1 | public function onRequestBeforeSend(Event $e) |
|
54 | } |
||
55 |