1 | <?php namespace Cornford\Pokenotifier; |
||
9 | abstract class NotifierBase implements NotifyingBaseInterface |
||
10 | { |
||
11 | const REQUEST_TIMEOUT = 120; |
||
12 | |||
13 | /** |
||
14 | * Slack Client. |
||
15 | * |
||
16 | * @var SlackClient |
||
17 | */ |
||
18 | private $slackClient; |
||
19 | |||
20 | /** |
||
21 | * Guzzle Client. |
||
22 | * |
||
23 | * @var GuzzleClient |
||
24 | */ |
||
25 | private $guzzleClient; |
||
26 | |||
27 | /** |
||
28 | * Directory Iterator. |
||
29 | * |
||
30 | * @var DirectoryIterator |
||
31 | */ |
||
32 | private $directoryIterator; |
||
33 | |||
34 | /** |
||
35 | * Application configuration. |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | private $applicationConfiguration; |
||
40 | |||
41 | /** |
||
42 | * Pokemon configuration. |
||
43 | * |
||
44 | * @var array |
||
45 | */ |
||
46 | private $pokemonConfiguration; |
||
47 | |||
48 | /** |
||
49 | * Constructor. |
||
50 | * |
||
51 | * @param GuzzleClient $guzzleClient |
||
52 | * @param SlackClient $slackClient |
||
53 | * @param DirectoryIterator $directoryIterator |
||
54 | */ |
||
55 | public function __construct( |
||
81 | |||
82 | /** |
||
83 | * Load Application configuration array. |
||
84 | * |
||
85 | * @return void |
||
86 | */ |
||
87 | public function loadApplicationConfiguration() |
||
91 | |||
92 | /** |
||
93 | * Get Application configuration array. |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | public function getApplicationConfiguration() |
||
101 | |||
102 | /** |
||
103 | * Get Pokemon configuration array. |
||
104 | * |
||
105 | * @return array |
||
106 | */ |
||
107 | public function loadPokemonConfiguration() |
||
111 | |||
112 | /** |
||
113 | * Get Pokemon configuration array. |
||
114 | * |
||
115 | * @return array |
||
116 | */ |
||
117 | public function getPokemonConfiguration() |
||
121 | |||
122 | /** |
||
123 | * Get configuration file. |
||
124 | * |
||
125 | * @param string $filepath |
||
126 | * |
||
127 | * @throws NotifierException |
||
128 | * |
||
129 | * @return array |
||
130 | */ |
||
131 | private function getConfigurationFile($filepath) |
||
139 | |||
140 | /** |
||
141 | * Create Guzzle client. |
||
142 | * |
||
143 | * @return void |
||
144 | */ |
||
145 | public function createGuzzleClient() |
||
159 | |||
160 | /** |
||
161 | * Get Guzzle client. |
||
162 | * |
||
163 | * @return GuzzleClient |
||
164 | */ |
||
165 | public function getGuzzleClient() |
||
169 | |||
170 | /** |
||
171 | * Set Guzzle client. |
||
172 | * |
||
173 | * @param GuzzleClient $class |
||
174 | * |
||
175 | * @return void |
||
176 | */ |
||
177 | public function setGuzzleClient(GuzzleClient $class) |
||
181 | |||
182 | /** |
||
183 | * Create Slack client. |
||
184 | * |
||
185 | * @return void |
||
186 | */ |
||
187 | public function createSlackClient() |
||
193 | |||
194 | /** |
||
195 | * Get Slack client. |
||
196 | * |
||
197 | * @return SlackClient |
||
198 | */ |
||
199 | public function getSlackClient() |
||
203 | |||
204 | /** |
||
205 | * Set Slack client. |
||
206 | * |
||
207 | * @param SlackClient $class |
||
208 | * |
||
209 | * @return void |
||
210 | */ |
||
211 | public function setSlackClient(SlackClient $class) |
||
215 | |||
216 | /** |
||
217 | * Create Directory Iterator. |
||
218 | * |
||
219 | * @return DirectoryIterator |
||
220 | */ |
||
221 | public function createDirectoryIterator() |
||
227 | |||
228 | /** |
||
229 | * Get Directory Iterator. |
||
230 | * |
||
231 | * @return DirectoryIterator |
||
232 | */ |
||
233 | public function getDirectoryIterator() |
||
237 | |||
238 | /** |
||
239 | * Set Directory Iterator. |
||
240 | * |
||
241 | * @param DirectoryIterator $class |
||
242 | * |
||
243 | * @return void |
||
244 | */ |
||
245 | public function setDirectoryIterator(DirectoryIterator $class) |
||
249 | |||
250 | } |