| Total Complexity | 4 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class UserDataValidator |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Checks if the given string is a valid username |
||
| 14 | * |
||
| 15 | * @param $username |
||
| 16 | * @return bool |
||
| 17 | */ |
||
| 18 | public static function isValidUsername(string $username): bool |
||
| 19 | { |
||
| 20 | return !(\preg_match('#[\W]+#', $username) === 1); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Checks if the given string is a valid UUID |
||
| 25 | * |
||
| 26 | * @param string $uuid |
||
| 27 | * @return bool |
||
| 28 | */ |
||
| 29 | public static function isValidUuid(string $uuid): bool |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Check if is an email address has invalid characters. |
||
| 36 | * |
||
| 37 | * @param string |
||
| 38 | * @return bool |
||
| 39 | */ |
||
| 40 | public static function isValidEmail(string $email): bool |
||
| 45 |