| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 76 | 4 | public function validate($schema = null) |
|
| 77 | { |
||
| 78 | 4 | libxml_use_internal_errors(true); |
|
| 79 | |||
| 80 | 4 | $dom = dom_import_simplexml($this->xorder->xml)->ownerDocument; |
|
| 81 | 4 | $valid = $dom->schemaValidate($this->getSchema($schema)); |
|
| 82 | |||
| 83 | 4 | if (!$valid) { |
|
| 84 | 2 | $errors = libxml_get_errors(); |
|
| 85 | 2 | throw new XOrderValidationException($errors); |
|
| 86 | } |
||
| 87 | |||
| 88 | 2 | libxml_use_internal_errors(false); |
|
| 89 | |||
| 90 | 2 | return $valid; |
|
| 91 | } |
||
| 92 | } |
||
| 93 |