1 | <?php |
||
26 | class GitterSystem extends AbstractSystem |
||
27 | { |
||
28 | /** |
||
29 | * System name |
||
30 | */ |
||
31 | private const SYSTEM_NAME = 'gitter'; |
||
32 | |||
33 | /** |
||
34 | * @var Client |
||
35 | */ |
||
36 | private $client; |
||
37 | |||
38 | /** |
||
39 | * @var UserInterface|null |
||
40 | */ |
||
41 | private $auth; |
||
42 | |||
43 | private $transformer; |
||
44 | |||
45 | /** |
||
46 | * GitterSystem constructor. |
||
47 | * @param string $token |
||
48 | * @throws \DomainException |
||
49 | */ |
||
50 | public function __construct(string $token) |
||
59 | |||
60 | /** |
||
61 | * @return Transformer |
||
62 | */ |
||
63 | public function getTransformer(): Transformer |
||
67 | |||
68 | /** |
||
69 | * @param LoopInterface $loop |
||
70 | * @param null|LoggerInterface $logger |
||
71 | */ |
||
72 | public function onRegister(LoopInterface $loop, ?LoggerInterface $logger): void |
||
79 | |||
80 | /** |
||
81 | * @return Client |
||
82 | */ |
||
83 | public function getClient(): Client |
||
87 | |||
88 | /** |
||
89 | * @return UserInterface |
||
90 | * @throws \Exception |
||
91 | * @throws \GuzzleHttp\Exception\ClientException |
||
92 | * @throws \InvalidArgumentException |
||
93 | * @throws \RuntimeException |
||
94 | * @throws \Throwable |
||
95 | */ |
||
96 | public function auth(): UserInterface |
||
108 | |||
109 | /** |
||
110 | * @param string $channelId |
||
111 | * @return bool |
||
112 | */ |
||
113 | public function has(string $channelId): bool |
||
123 | |||
124 | /** |
||
125 | * @param string $channelId |
||
126 | * @return ChannelInterface |
||
127 | * @throws \Throwable |
||
128 | * @throws \RuntimeException |
||
129 | * @throws \GuzzleHttp\Exception\ClientException |
||
130 | * @throws \Exception |
||
131 | * @throws \InvalidArgumentException |
||
132 | */ |
||
133 | public function channel(string $channelId): ChannelInterface |
||
141 | |||
142 | /** |
||
143 | * @return \Traversable|ChannelInterface[]|GitterChannel[] |
||
144 | * @throws \Exception |
||
145 | * @throws \GuzzleHttp\Exception\ClientException |
||
146 | * @throws \InvalidArgumentException |
||
147 | * @throws \RuntimeException |
||
148 | * @throws \Throwable |
||
149 | */ |
||
150 | public function channels(): \Traversable |
||
164 | |||
165 | /** |
||
166 | * @return array |
||
167 | */ |
||
168 | public function __debugInfo(): array |
||
174 | |||
175 | /** |
||
176 | * @return string |
||
177 | */ |
||
178 | public function getName(): string |
||
182 | } |
||
183 |