| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2.032 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 3 | protected function validateTokens(bool $hasComments) : Result |
|
| 14 | { |
||
| 15 | $invalidDomainTokens = array( |
||
| 16 | 3 | 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 | 3 | 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 | 3 | return new ValidEmail(); |
|
| 28 | } |
||
| 29 | } |