Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
StaticConfigurationLoader
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 loadTaskTypes
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 loadTopics
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDisabledTaskTypes
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace GrowthExperiments\NewcomerTasks\ConfigurationLoader;
4
5use GrowthExperiments\NewcomerTasks\TaskType\TaskType;
6use GrowthExperiments\NewcomerTasks\Topic\Topic;
7use StatusValue;
8
9/**
10 * A minimal ConfigurationLoader for testing and development which returns preconfigured values.
11 */
12class 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    /**
23     * @param TaskType[]|StatusValue $taskTypes
24     * @param Topic[]|StatusValue $topics
25     */
26    public function __construct( $taskTypes, $topics = [] ) {
27        $this->taskTypes = $taskTypes;
28        $this->topics = $topics;
29    }
30
31    /** @inheritDoc */
32    public function loadTaskTypes() {
33        return $this->taskTypes;
34    }
35
36    /** @inheritDoc */
37    public function loadTopics() {
38        return $this->topics;
39    }
40
41    /** @inheritDoc */
42    public function getDisabledTaskTypes(): array {
43        return [];
44    }
45
46}