Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function validate($value, Constraint $constraint) |
||
13 | { |
||
14 | /* @var $constraint \App\Validator\ConfirmPassword */ |
||
15 | |||
16 | if (null === $value || '' === $value) { |
||
17 | return; |
||
18 | } |
||
19 | |||
20 | $password = $this->context->getRoot()->get('password')->getData(); |
||
21 | |||
22 | if ($password !== $value) { |
||
23 | $this->context->buildViolation($constraint->message) |
||
24 | ->atPath('password_confirmation') |
||
25 | ->addViolation(); |
||
26 | } |
||
27 | } |
||
28 | } |
||
29 |