| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 35 | public function validate($value, Constraint $constraint) |
||
| 36 | { |
||
| 37 | $matrix = $value->getContentItemMatrix(); |
||
| 38 | |||
| 39 | if (null !== $matrix) { |
||
| 40 | foreach ($value->getContentItems() as $i => $contentItem) { |
||
| 41 | $type = get_class($contentItem); |
||
| 42 | |||
| 43 | if (!in_array($contentItem->getRegion(), $matrix->getRegions($type))) { |
||
| 44 | $this->context->addViolationAt( |
||
| 45 | 'contentItems[' . $i . ']', |
||
| 46 | $this->translator->trans( |
||
| 47 | "content_item.invalid.region.type.combination", |
||
| 48 | array( |
||
| 49 | '@region' => $contentItem->getRegion(), |
||
| 50 | '@type' => $type |
||
| 51 | ), |
||
| 52 | 'validators' |
||
| 53 | ) |
||
| 60 |