| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5 |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 49 | 5 | public function isValid($email, EmailLexer $emailLexer) |
|
| 50 | { |
||
| 51 | 5 | $result = true; |
|
| 52 | 5 | $errors = []; |
|
| 53 | 5 | foreach ($this->validations as $validation) { |
|
| 54 | 5 | $emailLexer->reset(); |
|
| 55 | 5 | $result = $result && $validation->isValid($email, $emailLexer); |
|
| 56 | 5 | $this->warnings = array_merge($this->warnings, $validation->getWarnings()); |
|
| 57 | 5 | $errors[] = $validation->getError(); |
|
| 58 | |||
| 59 | 5 | if (!$result && $this->breakIfError) { |
|
| 60 | 1 | break; |
|
| 61 | } |
||
| 62 | 5 | } |
|
| 63 | 5 | $this->error = new MultipleErrors($errors); |
|
| 64 | |||
| 65 | 5 | return $result; |
|
| 66 | } |
||
| 67 | |||
| 84 |