| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types = 1); |
||
| 25 | public function validate(Schema $schema, $value): ValidationResult |
||
| 26 | { |
||
| 27 | $validator = new JustinRainbowJsonSchemaValidator(); |
||
| 28 | $validator->check($value, $schema->getDefinition()); |
||
| 29 | |||
| 30 | $map = []; |
||
| 31 | foreach ($validator->getErrors() as $error) { |
||
| 32 | $map[$error['property']] = $error['message']; |
||
| 33 | } |
||
| 34 | |||
| 35 | return new ValidationResult($validator->isValid(), $map); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |