Conditions | 3 |
Paths | 9 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function isValid($msg) |
||
22 | { |
||
23 | try{ |
||
24 | $options = new Context(); |
||
25 | |||
26 | if ($this->definitions != null) { |
||
27 | $refProvider = new Preloaded(); |
||
28 | $refProvider->setSchemaData("defs.schema", json_decode(file_get_contents($this->definitions, true))); |
||
29 | $options->remoteRefProvider = $refProvider; |
||
30 | } |
||
31 | |||
32 | $schema = Schema::import(json_decode(file_get_contents($this->schema, true)), $options); |
||
33 | $schema->in($msg); |
||
34 | return null; |
||
35 | }catch (Exception $e){ |
||
36 | return $e->getMessage(); |
||
37 | } |
||
44 |