1 | <?php |
||
30 | class SlackProvider |
||
31 | { |
||
32 | const ALLOWED_RESPONSE_STATUSES = [ |
||
33 | Response::HTTP_OK, |
||
34 | Response::HTTP_MOVED_PERMANENTLY, |
||
35 | Response::HTTP_FOUND, |
||
36 | ]; |
||
37 | |||
38 | /** @var array */ |
||
39 | private $config; |
||
40 | |||
41 | /** @var string */ |
||
42 | private $apiUrl; |
||
43 | |||
44 | /** @var Client */ |
||
45 | private $client; |
||
46 | |||
47 | /** |
||
48 | * SlackProvider constructor. |
||
49 | * |
||
50 | * @param array $config |
||
51 | */ |
||
52 | public function __construct(array $config) |
||
61 | |||
62 | /** |
||
63 | * @param string $postBody |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | public function send(string $postBody): bool |
||
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | */ |
||
87 | public function getApiUrl(): string |
||
91 | |||
92 | /** |
||
93 | * @param string $apiUrl |
||
94 | * |
||
95 | * @return SlackProvider |
||
96 | */ |
||
97 | public function setApiUrl(string $apiUrl) |
||
103 | } |
||
104 |