Conditions | 3 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public function load(string $filepath) |
||
12 | { |
||
13 | if(!is_file($filepath) || !($fileContents = file_get_contents($filepath))){ |
||
14 | throw new \RuntimeException(sprintf('Could not open %s', $filepath)); |
||
15 | } |
||
16 | |||
17 | $contents = Yaml::parse($fileContents); |
||
18 | return new Config($contents); |
||
19 | } |
||
20 | } |