Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function validate($email, $options = []): Result |
||
13 | { |
||
14 | $this->validated = true; |
||
|
|||
15 | |||
16 | if (filter_var($email, FILTER_VALIDATE_EMAIL)) { |
||
17 | return $this->success(); |
||
18 | } |
||
19 | |||
20 | $error = new TypeError(TypeErrorCode::EMAIL_INVALID, 'The provided email is invalid.'); |
||
21 | return $this->failure($error); |
||
22 | } |
||
24 | } |