Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 12 | public function __construct($identity) |
|
20 | { |
||
21 | 12 | if (!preg_match('/^((\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,32}|[0-9]{1,32})(\]?))$/', $identity) |
|
22 | 12 | ) { |
|
23 | 1 | throw new InvalidIdentityException("The identity is not a valid domain"); |
|
24 | } |
||
25 | |||
26 | 12 | $this->identity = $identity; |
|
27 | 12 | } |
|
28 | |||
39 |