1 | <?php |
||
18 | class PasswordRequirementsValidator |
||
19 | { |
||
20 | private const NUMBER_REGEXP = '/[\d]{1,}/'; |
||
21 | private const LOWERCASE_LETTER_REGEXP = '/\p{Ll}{1,}/u'; |
||
22 | private const UPPERCASE_LETTER_REGEXP = '/\p{Lu}{1,}/u'; |
||
23 | |||
24 | /** |
||
25 | * @param string $password |
||
26 | * |
||
27 | * @return bool |
||
28 | */ |
||
29 | public function isValid(string $password): bool |
||
36 | |||
37 | /** |
||
38 | * @param string $password |
||
39 | * |
||
40 | * @return bool |
||
41 | */ |
||
42 | private function hasAtLeastOneNumber(string $password): bool |
||
46 | |||
47 | /** |
||
48 | * @param string $password |
||
49 | * |
||
50 | * @return bool |
||
51 | */ |
||
52 | private function hasAtLeastOneUnicodeUpperCaseLetter(string $password): bool |
||
56 | |||
57 | /** |
||
58 | * @param string $password |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | private function hasAtLeastOneUnicodeLowerCaseLetter(string $password): bool |
||
66 | } |
||
67 |