Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public static function parse($filename) |
||
21 | { |
||
22 | $ext = self::getExt($filename); |
||
23 | |||
24 | if (false === in_array($ext, self::$allowedExtensions)) { |
||
25 | throw new ParserException($ext . ' is not a valid extension [json, ini, xml, yaml, yml are supported].'); |
||
26 | } |
||
27 | |||
28 | $parser = self::getParser($ext); |
||
29 | |||
30 | try { |
||
31 | return $parser->parse($filename); |
||
|
|||
32 | } catch (\Exception $e) { |
||
33 | throw new ParserException($filename . ' cannot be parsed [' . $ext . ' driver used]'); |
||
34 | } |
||
70 |
If the returned type also contains false, it is an indicator that maybe an error condition leading to the specific return statement remains unhandled.