Total Complexity | 6 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
15 | class CredentialsValidator |
||
16 | { |
||
17 | /** |
||
18 | * @param string $subdomain |
||
19 | * @return bool |
||
20 | * @throws InvalidArgumentException |
||
21 | */ |
||
22 | 5 | public function validateSubdomain($subdomain) |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string $login |
||
34 | * @return bool |
||
35 | * @throws InvalidArgumentException |
||
36 | */ |
||
37 | 6 | public function validateLogin($login) |
|
38 | { |
||
39 | 6 | if (!StringUtil::isEmail($login)) { |
|
40 | 5 | $message = sprintf('"%s" is not a valid login', $login); |
|
41 | 5 | throw new InvalidArgumentException($message); |
|
42 | } |
||
43 | |||
44 | 1 | return true; |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * @param string $hash |
||
49 | * @return bool |
||
50 | * @throws InvalidArgumentException |
||
51 | */ |
||
52 | 5 | public function validateHash($hash) |
|
60 | } |
||
61 | } |