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