Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function validate($value, Constraint $constraint): void |
||
25 | { |
||
26 | if (! $constraint instanceof IpVN) { |
||
27 | throw new UnexpectedTypeException($constraint, IpVN::class); |
||
28 | } |
||
29 | |||
30 | if (false === ConcreteValidator::ipVN($constraint->version)->validate($value)) { |
||
31 | $this->context->buildViolation($constraint->message) |
||
32 | ->setParameter('{{ value }}', $this->formatValue($value)) |
||
33 | ->setCode($this->getCode($constraint->version)) |
||
34 | ->addViolation(); |
||
35 | } |
||
36 | } |
||
37 | |||
50 |