1 | <?php |
||
29 | class GitterSystem extends AbstractSystem |
||
30 | { |
||
31 | /** |
||
32 | * System name |
||
33 | */ |
||
34 | private const SYSTEM_NAME = 'gitter'; |
||
35 | |||
36 | /** |
||
37 | * @var Client |
||
38 | */ |
||
39 | private $client; |
||
40 | |||
41 | /** |
||
42 | * @var UserInterface|null |
||
43 | */ |
||
44 | private $auth; |
||
45 | |||
46 | /** |
||
47 | * @var Renderer |
||
48 | */ |
||
49 | private $renderer; |
||
50 | |||
51 | /** |
||
52 | * @var Parser |
||
53 | */ |
||
54 | private $parser; |
||
55 | |||
56 | /** |
||
57 | * GitterSystem constructor. |
||
58 | * @param string $token |
||
59 | * @throws \DomainException |
||
60 | */ |
||
61 | public function __construct(string $token) |
||
72 | |||
73 | /** |
||
74 | * @param string $html |
||
75 | * @return string |
||
76 | */ |
||
77 | public function renderMessage(string $html): string |
||
81 | |||
82 | /** |
||
83 | * @param string $html |
||
84 | * @return string |
||
85 | */ |
||
86 | public function parseMessage(string $html): string |
||
90 | |||
91 | /** |
||
92 | * @param LoopInterface $loop |
||
93 | * @param null|LoggerInterface $logger |
||
94 | */ |
||
95 | public function onRegister(LoopInterface $loop, ?LoggerInterface $logger): void |
||
102 | |||
103 | /** |
||
104 | * @return Client |
||
105 | */ |
||
106 | public function getClient(): Client |
||
110 | |||
111 | /** |
||
112 | * @return UserInterface |
||
113 | * @throws \Exception |
||
114 | * @throws \GuzzleHttp\Exception\ClientException |
||
115 | * @throws \InvalidArgumentException |
||
116 | * @throws \RuntimeException |
||
117 | * @throws \Throwable |
||
118 | */ |
||
119 | public function auth(): UserInterface |
||
131 | |||
132 | /** |
||
133 | * @param string $channelId |
||
134 | * @return ChannelInterface |
||
135 | * @throws \Throwable |
||
136 | * @throws \RuntimeException |
||
137 | * @throws \GuzzleHttp\Exception\ClientException |
||
138 | * @throws \Exception |
||
139 | * @throws \InvalidArgumentException |
||
140 | */ |
||
141 | public function channel(string $channelId): ChannelInterface |
||
149 | |||
150 | /** |
||
151 | * @param string $channelId |
||
152 | * @return bool |
||
153 | */ |
||
154 | public function has(string $channelId): bool |
||
163 | |||
164 | /** |
||
165 | * @return \Traversable|ChannelInterface[]|GitterChannel[] |
||
166 | * @throws \Exception |
||
167 | * @throws \GuzzleHttp\Exception\ClientException |
||
168 | * @throws \InvalidArgumentException |
||
169 | * @throws \RuntimeException |
||
170 | * @throws \Throwable |
||
171 | */ |
||
172 | public function channels(): \Traversable |
||
186 | |||
187 | /** |
||
188 | * @return array |
||
189 | */ |
||
190 | public function __debugInfo(): array |
||
196 | |||
197 | /** |
||
198 | * @return string |
||
199 | */ |
||
200 | public function getName(): string |
||
204 | } |
||
205 |