Conditions | 3 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | 3 | public function getConfiguration() : Configuration |
|
42 | { |
||
43 | 3 | if (count($this->loaders) === 0) { |
|
44 | 3 | $this->setDefaultLoaders(); |
|
45 | } |
||
46 | |||
47 | 3 | $extension = pathinfo($this->file, PATHINFO_EXTENSION); |
|
48 | 3 | if (! isset($this->loaders[$extension])) { |
|
49 | 1 | throw Configuration\Exception\InvalidConfigurationFormat::new($this->file); |
|
50 | } |
||
51 | |||
52 | 2 | return $this->loaders[$extension]($this->file)->getConfiguration(); |
|
53 | } |
||
55 |