Conditions | 4 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function validate($password, Constraint $constraint) |
||
23 | { |
||
24 | |||
25 | if (!is_null($password) && !empty($password)) { |
||
26 | $check = new PhpComplexify( |
||
27 | array( |
||
28 | $constraint->minimumChars, |
||
29 | $constraint->strengthScaleFactor, |
||
30 | $constraint->bannedPasswords, |
||
31 | $constraint->banMode, |
||
32 | $constraint->encoding, |
||
33 | ) |
||
34 | ); |
||
35 | |||
36 | $result = $check->evaluateSecurity($password); |
||
37 | |||
38 | if (!$result->valid) { |
||
39 | $this->context->addViolation($constraint->message); |
||
40 | } |
||
41 | } |
||
42 | |||
43 | } |
||
44 | |||
46 |