Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
StaticConfigurationLoader | |
0.00% |
0 / 7 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
loadTaskTypes | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
loadTopics | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDisabledTaskTypes | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
loadInfoboxTemplates | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
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 | * A minimal ConfigurationLoader for testing and development which returns preconfigured values. |
11 | */ |
12 | class StaticConfigurationLoader implements ConfigurationLoader { |
13 | |
14 | use ConfigurationLoaderTrait; |
15 | |
16 | /** @var TaskType[]|StatusValue */ |
17 | private $taskTypes; |
18 | |
19 | /** @var Topic[]|StatusValue */ |
20 | private $topics; |
21 | |
22 | /** @var string[]|StatusValue */ |
23 | private $infoboxTemplates; |
24 | |
25 | /** |
26 | * @param TaskType[]|StatusValue $taskTypes |
27 | * @param Topic[]|StatusValue $topics |
28 | * @param string[]|StatusValue $infoboxTemplates |
29 | */ |
30 | public function __construct( $taskTypes, $topics = [], $infoboxTemplates = [] ) { |
31 | $this->taskTypes = $taskTypes; |
32 | $this->topics = $topics; |
33 | $this->infoboxTemplates = $infoboxTemplates; |
34 | } |
35 | |
36 | /** @inheritDoc */ |
37 | public function loadTaskTypes() { |
38 | return $this->taskTypes; |
39 | } |
40 | |
41 | /** @inheritDoc */ |
42 | public function loadTopics() { |
43 | return $this->topics; |
44 | } |
45 | |
46 | /** @inheritDoc */ |
47 | public function getDisabledTaskTypes(): array { |
48 | return []; |
49 | } |
50 | |
51 | /** @inheritDoc */ |
52 | public function loadInfoboxTemplates() { |
53 | return $this->infoboxTemplates; |
54 | } |
55 | } |