Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
24 | 4 | public function __construct($identity) |
|
25 | { |
||
26 | 4 | if (!preg_match('/^.+\@\S+\.\S+$/', $identity) |
|
27 | 4 | && !preg_match('/^((\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,32}|[0-9]{1,32})(\]?))$/', $identity)) { |
|
28 | 1 | throw new InvalidIdentityException("The identity is not a valid domain or email address"); |
|
29 | } |
||
30 | |||
31 | |||
32 | 4 | $this->identity = $identity; |
|
33 | 4 | } |
|
34 | |||
73 |