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