1 | <?php |
||
17 | class WebHookController extends AbstractHookController |
||
18 | { |
||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $colorMap = [ |
||
23 | 'info' => Message\Attachment::COLOR_INFO, |
||
24 | 'ok' => Message\Attachment::COLOR_GOOD, |
||
25 | 'warning' => Message\Attachment::COLOR_WARNING, |
||
26 | 'danger' => Message\Attachment::COLOR_DANGER, |
||
27 | 'notice' => Message\Attachment::COLOR_NOTICE, |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * public method to start processing the request. |
||
32 | * |
||
33 | * @param string $hook |
||
34 | * @param string $input |
||
35 | * |
||
36 | * Input example: |
||
37 | * { |
||
38 | * "securityToken": "a valid security token", |
||
39 | * "color": [info|ok|warning|danger|notice|#HEXCODE], |
||
40 | * "title": "Title of the message" |
||
41 | * "text": "Text of the message" |
||
42 | * } |
||
43 | * |
||
44 | * @throws \Doctrine\DBAL\DBALException |
||
45 | */ |
||
46 | 9 | public function process($hook, $input = 'php://input') |
|
78 | } |
||
79 |