Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 80% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | final class FormattedFile extends ConfigurationFile |
||
16 | { |
||
17 | /** @var callable[] */ |
||
18 | private $loaders = []; |
||
19 | |||
20 | 3 | private function setDefaultLoaders() : void |
|
21 | { |
||
22 | 3 | $this->loaders = [ |
|
23 | 'json' => static function ($file) : ConfigurationLoader { |
||
24 | return new JsonFile($file); |
||
25 | 3 | }, |
|
26 | 'php' => static function ($file) : ConfigurationLoader { |
||
27 | 2 | return new PhpFile($file); |
|
28 | 3 | }, |
|
29 | 'xml' => static function ($file) : ConfigurationLoader { |
||
30 | return new XmlFile($file); |
||
31 | 3 | }, |
|
32 | 'yaml' => static function ($file) : ConfigurationLoader { |
||
33 | return new YamlFile($file); |
||
34 | 3 | }, |
|
35 | 'yml' => static function ($file) : ConfigurationLoader { |
||
36 | return new YamlFile($file); |
||
37 | 3 | }, |
|
38 | ]; |
||
39 | 3 | } |
|
40 | |||
41 | 3 | public function getConfiguration() : Configuration |
|
53 | } |
||
54 | } |
||
55 |