| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.016 |
| 1 | <?php |
||
| 12 | 4 | public static function validate($data, $parameter, SubSchemaValidatorFactory $validatorFactory, $pointer = null) |
|
| 13 | { |
||
| 14 | 4 | if (!is_array($parameter)) { |
|
| 15 | return null; |
||
| 16 | } |
||
| 17 | |||
| 18 | 4 | $errors = array_merge(array_filter(array_map(function ($schema) use ($data, $validatorFactory, $pointer) { |
|
| 19 | 4 | $validator = $validatorFactory->makeSubSchemaValidator($data, $schema, $pointer); |
|
| 20 | 4 | if ($validator->passes()) { |
|
| 21 | 4 | return null; |
|
| 22 | } |
||
| 23 | 4 | return $validator->errors(); |
|
| 24 | 4 | }, $parameter))); |
|
| 25 | |||
| 26 | 4 | return $errors ?: null; |
|
| 27 | } |
||
| 28 | } |
||
| 29 |