Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
20 | 2 | public function validateSchema(CheckRequest $checkRequest): void |
|
21 | { |
||
22 | 2 | $schemaLocation = $checkRequest->getResponseSchemaLocation(); |
|
23 | 2 | $schemaValidatorFactory = $this->getSchemaValidatorFactory(); |
|
24 | |||
25 | 2 | if (!$schemaValidatorFactory->hasSchema($schemaLocation)) { |
|
26 | 2 | $schemaValidatorFactory->registerSchema($schemaLocation, $schemaLocation); |
|
27 | } |
||
28 | |||
29 | 2 | $schemaValidator = $schemaValidatorFactory->getValidator($schemaLocation); |
|
30 | |||
31 | 2 | $checkRequest->setValidationResult($schemaValidator->validate($checkRequest->getContent())); |
|
32 | 2 | } |
|
33 | |||
39 |