Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public static function isValid($xml) |
||
22 | { |
||
23 | $useErrors = libxml_use_internal_errors(true); |
||
24 | |||
25 | $isCorrect = simplexml_load_string($xml); |
||
26 | |||
27 | libxml_use_internal_errors($useErrors); |
||
28 | |||
29 | if (false === $isCorrect) { |
||
30 | throw ParserException::notXml($xml); |
||
31 | } |
||
32 | |||
33 | return true; |
||
34 | } |
||
35 | } |
||
36 |