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