Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace GrowthExperiments\NewcomerTasks\ConfigurationLoader; |
4 | |
5 | use GrowthExperiments\NewcomerTasks\TaskType\TaskType; |
6 | use GrowthExperiments\NewcomerTasks\Topic\Topic; |
7 | use StatusValue; |
8 | |
9 | /** |
10 | * Helper for retrieving task recommendation configuration. |
11 | */ |
12 | interface ConfigurationLoader { |
13 | |
14 | /** |
15 | * Load configured task types. |
16 | * @return TaskType[]|StatusValue Set of configured task types, or an error status. |
17 | */ |
18 | public function loadTaskTypes(); |
19 | |
20 | /** |
21 | * Load configured topics. |
22 | * @return Topic[]|StatusValue |
23 | */ |
24 | public function loadTopics(); |
25 | |
26 | /** |
27 | * Load configured infobox templates. |
28 | * @return string[]|StatusValue |
29 | */ |
30 | public function loadInfoboxTemplates(); |
31 | |
32 | /** |
33 | * Convenience method to get task types as an array of task type id => task type. |
34 | * |
35 | * If an error is generated while loading task types, an empty array is |
36 | * returned. |
37 | * |
38 | * @return TaskType[] |
39 | */ |
40 | public function getTaskTypes(): array; |
41 | |
42 | /** |
43 | * Returns task types which have been disabled by configuration, keyed by task type ID. |
44 | * (loadTaskTypes() / getTaskTypes() will not return these.) |
45 | * |
46 | * Empty array when task type configuration fails to load. |
47 | * |
48 | * @return TaskType[] |
49 | */ |
50 | public function getDisabledTaskTypes(): array; |
51 | |
52 | /** |
53 | * Convenience method to get topics as an array of topic id => topic. |
54 | * |
55 | * If an error is generated while loading, an empty array is returned. |
56 | * |
57 | * @return Topic[] |
58 | */ |
59 | public function getTopics(): array; |
60 | } |