Conditions | 3 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function validate($value, Constraint $constraint) { |
||
24 | /** @var \Drupal\crop\Entity\CropType $value */ |
||
25 | $aspect_ratio = $value->getAspectRatio(); |
||
26 | if (!empty($aspect_ratio) && !preg_match($value::VALIDATION_REGEXP, $aspect_ratio)) { |
||
27 | $this->context->buildViolation($constraint->message) |
||
28 | ->atPath('aspect_ratio') |
||
29 | ->addViolation(); |
||
30 | } |
||
31 | } |
||
32 | |||
34 |