1 | <?php namespace RuleCom\Notifier\Channels; |
||
7 | class Slack implements Channel |
||
8 | { |
||
9 | /** |
||
10 | * @var Client |
||
11 | */ |
||
12 | private $client; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $endpoint; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $channel; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $message; |
||
28 | |||
29 | /** |
||
30 | * @var Logger |
||
31 | */ |
||
32 | private $logger; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $logPath; |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | private $debug = false; |
||
43 | |||
44 | public function __construct(Client $client, Logger $logger = null) |
||
49 | |||
50 | public function debug($logPath) |
||
56 | |||
57 | /** |
||
58 | * @param string $endpoint |
||
59 | * @return $this |
||
60 | */ |
||
61 | public function endpoint($endpoint) |
||
66 | |||
67 | /** |
||
68 | * @param string $channel |
||
69 | * @return $this |
||
70 | */ |
||
71 | public function channel($channel) |
||
76 | |||
77 | /** |
||
78 | * @param string $message |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function message($message) |
||
86 | |||
87 | /** |
||
88 | * Dispatch notification message |
||
89 | */ |
||
90 | public function dispatch() |
||
103 | |||
104 | /** |
||
105 | * Fakes dispatch by logging instead |
||
106 | */ |
||
107 | private function fakeDispatch() |
||
112 | } |
||
113 |