Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | public function doValidation(Response $response) |
||
14 | { |
||
15 | $domDocument = new \DOMDocument(); |
||
16 | $success = @$domDocument->loadXML((string) $response->getBody()); // true/false |
||
17 | |||
18 | $lastError = libxml_get_last_error(); |
||
19 | if (!$success || $lastError) { |
||
20 | throw new \RuntimeException('The xml file '. $response->getUri() . ' is not well formed (last error: ' . |
||
21 | str_replace("\n", '', $lastError->message) . ').'); |
||
22 | } |
||
23 | } |
||
24 | } |
||
25 |