| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | public function validate($message) |
||
| 8 | { |
||
| 9 | libxml_use_internal_errors(true); |
||
| 10 | $response = simplexml_load_string($message, 'SimpleXMLElement', LIBXML_NOCDATA); |
||
| 11 | |||
| 12 | if ($response === false) { |
||
| 13 | $unvalidatedMessage = is_string($message) ? $message : ''; |
||
| 14 | throw new \Exception('Não foi possível identificar o XML de retorno.'.$unvalidatedMessage); |
||
| 15 | } |
||
| 16 | |||
| 17 | return $response; |
||
| 18 | } |
||
| 25 |