| Conditions | 4 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function validate($value, Constraint $constraint) |
||
| 19 | { |
||
| 20 | $type = TypeRegistry::getInstance()->find($constraint->type); |
||
| 21 | $parameter = ParameterRegistry::getInstance()->find($constraint->parameter); |
||
| 22 | if (!$type || !$parameter || !in_array($parameter, $type->getParameters())) { |
||
| 23 | $this |
||
| 24 | ->context |
||
| 25 | ->buildViolation($constraint->message) |
||
| 26 | ->setParameter('{{ type }}', $constraint->type) |
||
| 27 | ->setParameter('{{ parameter }}', $constraint->parameter) |
||
| 28 | ->addViolation(); |
||
| 29 | } |
||
| 32 |