| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 46 | 4 | public function load($filename) |
|
| 47 | { |
||
| 48 | 4 | $data = file_get_contents($filename); |
|
| 49 | |||
| 50 | try { |
||
| 51 | 4 | $config = $this->serializer->deserialize($data, Config::class, 'json'); |
|
| 52 | 3 | } catch (UnexpectedValueException $exception) { |
|
| 53 | 2 | throw new \InvalidArgumentException('Invalid configuration file', 0, $exception); |
|
| 54 | } |
||
| 55 | |||
| 56 | 2 | return $config; |
|
| 57 | } |
||
| 58 | } |
||
| 59 |