Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | protected function isValid($file) |
||
17 | { |
||
18 | if (function_exists('yaml_parse_file')) { |
||
19 | return (@yaml_parse_file($file) === false) ? false : true; |
||
20 | } |
||
21 | |||
22 | if (class_exists('Symfony\Component\Yaml\Parser')) { |
||
23 | try { |
||
24 | (new Parser())->parse(file_get_contents($file)); |
||
25 | } catch (ParseException $e) { |
||
26 | return false; |
||
27 | } |
||
28 | |||
29 | return true; |
||
30 | } |
||
31 | |||
32 | return false; |
||
33 | } |
||
35 |