1 | <?php |
||
20 | abstract class AbstractHookController |
||
21 | { |
||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $configuration; |
||
26 | |||
27 | /** |
||
28 | * GerritHookController constructor. |
||
29 | * |
||
30 | * @param array $configuration |
||
31 | */ |
||
32 | 22 | public function __construct(array $configuration = []) |
|
36 | |||
37 | /** |
||
38 | * public method to start processing the request. |
||
39 | * |
||
40 | * @param string $hook |
||
41 | * @param string $input |
||
42 | * |
||
43 | * @throws \Doctrine\DBAL\DBALException |
||
44 | */ |
||
45 | abstract public function process($hook, $input = 'php://input'); |
||
46 | |||
47 | /** |
||
48 | * @param Message $payload |
||
49 | * @param string $channel |
||
50 | * |
||
51 | * @throws \Doctrine\DBAL\DBALException |
||
52 | */ |
||
53 | 3 | protected function postToSlack(Message $payload, $channel) |
|
89 | |||
90 | /** |
||
91 | * @param array $data |
||
92 | * |
||
93 | * @throws \Doctrine\DBAL\DBALException |
||
94 | */ |
||
95 | 2 | protected function addMessageToQueue(array $data) |
|
101 | |||
102 | /** |
||
103 | * @param string $haystack |
||
104 | * @param string $needle |
||
105 | * |
||
106 | * @return bool |
||
107 | */ |
||
108 | protected function endsWith($haystack, $needle) : bool |
||
116 | } |
||
117 |