Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
27 | 1 | public function passes($password) |
|
28 | { |
||
29 | 1 | $size = $this->occurrence->size(); |
|
30 | |||
31 | 1 | $regex = preg_quote(implode($this->dictionary->handle()), '/'); |
|
32 | |||
33 | 1 | $regex = array_fill(0, $size, '[' . $regex . ']'); |
|
34 | |||
35 | 1 | $regex = '/(?=.*' . implode('.*', $regex) . ')/'; |
|
36 | |||
37 | 1 | return preg_match($regex, $password); |
|
38 | } |
||
39 | } |
||
40 |