Conditions | 4 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 4.3731 |
Changes | 0 |
1 | <?php namespace Comodojo\Foundation\Base; |
||
28 | 3 | protected static function importData($file) { |
|
29 | |||
30 | 3 | if ( file_exists($file) && is_readable($file) ) { |
|
31 | |||
32 | 3 | $data = @file_get_contents($file); |
|
33 | |||
34 | 3 | if ( $data !== false ) { |
|
35 | |||
36 | 3 | return Yaml::parse($data); |
|
37 | |||
38 | } else { |
||
39 | throw new ConfigurationException("Configuration file $file not readable"); |
||
40 | } |
||
41 | |||
42 | } else { |
||
43 | throw new ConfigurationException("Configuration file $file not found"); |
||
44 | } |
||
45 | |||
46 | } |
||
47 | |||
49 |