1 | <?php |
||
18 | class PasswordRequirementsValidator |
||
19 | { |
||
20 | public const NUMBER_REGEXP = '/[\d]{1,}/'; |
||
21 | |||
22 | public const LOWERCASE_LETTER_REGEXP = '/\p{Ll}{1,}/u'; |
||
23 | |||
24 | public const UPPERCASE_LETTER_REGEXP = '/\p{Lu}{1,}/u'; |
||
25 | |||
26 | /** |
||
27 | * @param string $password |
||
28 | * |
||
29 | * @return bool |
||
30 | */ |
||
31 | public function isValid(string $password): bool |
||
38 | |||
39 | /** |
||
40 | * @param string $password |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | private function hasAtLeastOneNumber(string $password): bool |
||
48 | |||
49 | /** |
||
50 | * @param string $password |
||
51 | * |
||
52 | * @return bool |
||
53 | */ |
||
54 | private function hasAtLeastOneUnicodeUpperCaseLetter(string $password): bool |
||
58 | |||
59 | /** |
||
60 | * @param string $password |
||
61 | * |
||
62 | * @return bool |
||
63 | */ |
||
64 | private function hasAtLeastOneUnicodeLowerCaseLetter(string $password): bool |
||
68 | } |
||
69 |