Conditions | 3 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types = 1); |
||
38 | public function validate(): bool |
||
39 | { |
||
40 | $schema = $this->getSchema(); |
||
41 | $schemaDecode = json_last_error(); |
||
42 | $data = $this->getData(); |
||
43 | |||
44 | $dataDecode = json_last_error(); |
||
45 | |||
46 | if ($schemaDecode != JSON_ERROR_NONE || |
||
47 | $dataDecode != JSON_ERROR_NONE |
||
48 | ) { |
||
49 | throw new JsonSchemaValidatorException(JsonSchemaValidatorException::WASNT_POSSIBLE_DECODE_PARAMETERS); |
||
50 | } |
||
51 | |||
52 | $schema = BaseSchema::import($schema); |
||
53 | $schema->in($data); |
||
54 | |||
55 | return true; |
||
56 | } |
||
58 |