| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 38 | 3 | public function readConfiguration() |
|
| 39 | { |
||
| 40 | // Check that the configuration file is readable |
||
| 41 | 3 | if (!is_readable($this->_file)) |
|
| 42 | 3 | throw new InvalidConfigurationException('The configuration file does not exist or is not readable'); |
|
| 43 | |||
| 44 | // Parse the configuration file |
||
| 45 | try |
||
| 46 | { |
||
| 47 | 2 | return (array)Yaml::parse(file_get_contents($this->_file)); |
|
| 48 | } |
||
| 49 | 1 | catch (ParseException $e) |
|
| 50 | { |
||
| 51 | 1 | throw new InvalidConfigurationException('Failed to parse the specified configuration file: ' . $e->getMessage()); |
|
| 52 | } |
||
| 56 |