| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public static function isXmlString($string) |
||
| 39 | { |
||
| 40 | $string = trim($string); |
||
| 41 | |||
| 42 | if (substr($string, 0, 1) === '<' && substr($string, -1, 1) === '>') { |
||
| 43 | try { |
||
| 44 | $dom = new \DOMDocument('1.0'); |
||
| 45 | $dom->validateOnParse = true; |
||
| 46 | return $dom->loadXML($string) !== false; |
||
| 47 | } catch (\Exception $e) { |
||
|
|
|||
| 48 | |||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 52 | return false; |
||
| 53 | } |
||
| 54 | |||
| 74 |