Total Complexity | 4 |
Total Lines | 16 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class XmlValidator implements ValidatorInterface |
||
8 | { |
||
9 | public $schema = null; |
||
10 | |||
11 | public function setSchema($schema, $schema_url=null, $definitions=null) { |
||
12 | $this->schema = $schema; |
||
13 | } |
||
14 | public function validate($msg) |
||
15 | { |
||
16 | $xml = new DOMDocument(); |
||
17 | $xml->load($msg); |
||
18 | return $xml->schemaValidate($this->schema) == true ? null : "XML schema validation failed."; |
||
|
|||
19 | } |
||
20 | |||
21 | public function getContentType() { |
||
23 | } |
||
24 | } |
||
25 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.