| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 2.0625 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | 6 | protected function validateTokens(bool $hasComments) : Result |
|
| 14 | { |
||
| 15 | $invalidDomainTokens = [ |
||
| 16 | EmailLexer::S_DQUOTE => true, |
||
| 17 | EmailLexer::S_SQUOTE => true, |
||
| 18 | EmailLexer::S_BACKTICK => true, |
||
| 19 | EmailLexer::S_SEMICOLON => true, |
||
| 20 | EmailLexer::S_GREATERTHAN => true, |
||
| 21 | EmailLexer::S_LOWERTHAN => true, |
||
| 22 | ]; |
||
| 23 | |||
| 24 | 6 | if (isset($invalidDomainTokens[$this->lexer->token['type']])) { |
|
| 25 | return new InvalidEmail(new ExpectingATEXT('Invalid token in domain: ' . $this->lexer->token['value']), $this->lexer->token['value']); |
||
| 26 | } |
||
| 27 | 6 | return new ValidEmail(); |
|
| 28 | } |
||
| 29 | } |