Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | 8 | public function __construct($email) |
|
31 | { |
||
32 | 8 | if (!$this->emailIsValid($email)) { |
|
33 | 1 | throw new InvalidArgumentException('You should inform a valid email.'); |
|
34 | } |
||
35 | |||
36 | 7 | if (!$this->mxIsValid($email)) { |
|
37 | 1 | throw new InvalidArgumentException('You must provide an email with valid MX.'); |
|
38 | } |
||
39 | |||
40 | 6 | list($this->username, $this->hostname) = explode('@', $email); |
|
41 | 6 | } |
|
42 | |||
85 |