Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2.0023 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 6 | protected function validateTokens(bool $hasComments) : Result |
|
14 | { |
||
15 | 6 | $invalidDomainTokens = [ |
|
16 | 6 | EmailLexer::S_DQUOTE => true, |
|
17 | 6 | EmailLexer::S_SQUOTE => true, |
|
18 | 6 | EmailLexer::S_BACKTICK => true, |
|
19 | 6 | EmailLexer::S_SEMICOLON => true, |
|
20 | 6 | EmailLexer::S_GREATERTHAN => true, |
|
21 | 6 | EmailLexer::S_LOWERTHAN => true, |
|
22 | 6 | ]; |
|
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 | } |
||
30 |