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