Conditions | 3 |
Paths | 9 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function validate($msg) |
||
26 | { |
||
27 | try{ |
||
28 | $options = new Context(); |
||
29 | |||
30 | if ($this->definitions != null) { |
||
31 | $refProvider = new Preloaded(); |
||
32 | $refProvider->setSchemaData($this->schema_url, json_decode(file_get_contents($this->definitions, true))); |
||
33 | $options->remoteRefProvider = $refProvider; |
||
34 | } |
||
35 | |||
36 | $schema = Schema::import(json_decode(file_get_contents($this->schema, true)), $options); |
||
37 | $schema->in(json_decode($msg)); |
||
38 | return null; |
||
39 | }catch (Exception $e){ |
||
40 | return $e->getMessage(); |
||
41 | } |
||
48 |