1 | <?php |
||
14 | abstract class AbstractBot |
||
15 | { |
||
16 | /** |
||
17 | * Dependencies. |
||
18 | */ |
||
19 | protected $config; |
||
20 | protected $listener; |
||
21 | protected $messageUtility; |
||
22 | protected $commandContainer; |
||
23 | protected $formattingUtility; |
||
24 | protected $loggerUtility; |
||
25 | protected $oauth; |
||
26 | protected $blackList; |
||
27 | protected $whiteList; |
||
28 | protected $sender; |
||
29 | protected $dictionary; |
||
30 | protected $commandExtractor; |
||
31 | |||
32 | /** |
||
33 | * @return Config |
||
34 | */ |
||
35 | 41 | public function getConfig() |
|
43 | |||
44 | /** |
||
45 | * @param Config $config |
||
46 | */ |
||
47 | 10 | public function setConfig(Config $config) |
|
51 | |||
52 | /** |
||
53 | * @return AbstractBaseListener |
||
54 | */ |
||
55 | 31 | public function getListener() |
|
64 | |||
65 | 31 | public function setListener(AbstractBaseListener $listener) |
|
69 | |||
70 | /** |
||
71 | * @return MessageUtility |
||
72 | */ |
||
73 | 3 | public function getMessageUtility() |
|
81 | |||
82 | /** |
||
83 | * @param MessageUtility $messageUtility |
||
84 | */ |
||
85 | 3 | public function setMessageUtility(MessageUtility $messageUtility) |
|
89 | |||
90 | /** |
||
91 | * @return CommandContainer |
||
92 | */ |
||
93 | 1 | public function getCommandContainer() |
|
101 | |||
102 | /** |
||
103 | * @param CommandContainer $commandContainer |
||
104 | */ |
||
105 | 1 | public function setCommandContainer(CommandContainer $commandContainer) |
|
109 | |||
110 | /** |
||
111 | * @return FormattingUtility |
||
112 | */ |
||
113 | 2 | public function getFormattingUtility() |
|
121 | |||
122 | /** |
||
123 | * @param FormattingUtility $formattingUtility |
||
124 | */ |
||
125 | 2 | public function setFormattingUtility(FormattingUtility $formattingUtility) |
|
129 | |||
130 | /** |
||
131 | * @return LoggerUtility |
||
132 | */ |
||
133 | 1 | public function getLoggerUtility() |
|
141 | |||
142 | /** |
||
143 | * @param LoggerUtility $loggerUtility |
||
144 | */ |
||
145 | 1 | public function setLoggerUtility(LoggerUtility $loggerUtility) |
|
149 | |||
150 | /** |
||
151 | * @return OAuth |
||
152 | */ |
||
153 | 2 | public function getOauth() |
|
161 | |||
162 | /** |
||
163 | * @param OAuth $oauth |
||
164 | */ |
||
165 | 2 | public function setOauth(OAuth $oauth) |
|
169 | |||
170 | /** |
||
171 | * @return RequestUtility |
||
172 | */ |
||
173 | 2 | public function getRequestUtility() |
|
177 | |||
178 | /** |
||
179 | * @param RequestUtility $requestUtility |
||
180 | */ |
||
181 | 3 | public function setRequestUtility(RequestUtility $requestUtility) |
|
185 | |||
186 | /** |
||
187 | * @return BlackList |
||
188 | */ |
||
189 | 1 | public function getBlackList() |
|
190 | { |
||
191 | 1 | if (!isset($this->blackList)) { |
|
192 | $this->setBlackList(new BlackList($this->getListener()->getRequest())); |
||
193 | } |
||
194 | |||
195 | 1 | return $this->blackList; |
|
196 | } |
||
197 | |||
198 | /** |
||
199 | * @param BlackList $blackList |
||
200 | */ |
||
201 | 1 | public function setBlackList(BlackList $blackList) |
|
205 | |||
206 | /** |
||
207 | * @return WhiteList |
||
208 | */ |
||
209 | public function getWhiteList() |
||
210 | { |
||
211 | if (!isset($this->whiteList)) { |
||
212 | $this->setWhiteList(new WhiteList($this->getListener()->getRequest())); |
||
213 | } |
||
214 | |||
215 | return $this->whiteList; |
||
216 | } |
||
217 | |||
218 | /** |
||
219 | * @param WhiteList $whiteList |
||
220 | */ |
||
221 | public function setWhiteList(WhiteList $whiteList) |
||
222 | { |
||
223 | $this->whiteList = $whiteList; |
||
224 | } |
||
225 | |||
226 | /** |
||
227 | * @return Sender |
||
228 | */ |
||
229 | 3 | public function getSender() |
|
237 | |||
238 | /** |
||
239 | * @param Sender $sender |
||
240 | */ |
||
241 | 3 | public function setSender(Sender $sender) |
|
245 | |||
246 | /** |
||
247 | * @return Dictionary |
||
248 | */ |
||
249 | 2 | public function getDictionary() |
|
257 | |||
258 | /** |
||
259 | * @param Dictionary $dictionary |
||
260 | */ |
||
261 | 2 | public function setDictionary(Dictionary $dictionary) |
|
265 | |||
266 | /** |
||
267 | * @return CommandExtractor |
||
268 | */ |
||
269 | 4 | public function getCommandExtractor() |
|
277 | |||
278 | /** |
||
279 | * @param CommandExtractor $commandExtractor |
||
280 | */ |
||
281 | 4 | public function setCommandExtractor(CommandExtractor $commandExtractor) |
|
285 | } |
||
286 |