Conditions | 3 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 12 |
Ratio | 100 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
32 | 22 | View Code Duplication | public function apply($instance, stdClass $schema, Context $context, Walker $walker) |
33 | { |
||
34 | 22 | $originalCount = $context->countViolations(); |
|
35 | |||
36 | 22 | foreach ($schema->allOf as $subSchema) { |
|
37 | 22 | $walker->applyConstraints($instance, $subSchema, $context); |
|
38 | 22 | } |
|
39 | |||
40 | 22 | if ($context->countViolations() > $originalCount) { |
|
41 | 12 | $context->addViolation('instance must match all the schemas listed in allOf'); |
|
42 | 12 | } |
|
43 | 22 | } |
|
44 | } |
||
45 |