Code Duplication    Length = 3-3 lines in 5 locations

EmailValidator/Parser/Comment.php 2 locations

@@ 36-38 (lines=3) @@
33
            }
34
        }
35
36
        if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) {
37
            return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']);
38
        }
39
40
        $this->warnings[WarningComment::CODE] = new WarningComment();
41
@@ 57-59 (lines=3) @@
54
55
        if($this->openedParenthesis >= 1) {
56
            return new InvalidEmail(new UnclosedComment(), $this->lexer->token['value']);
57
        } else if ($this->openedParenthesis < 0) {
58
            return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']);
59
        }
60
61
        $finalValidations = $this->commentStrategy->endOfLoopValidations($this->lexer);
62

EmailValidator/Parser/DomainPart.php 2 locations

@@ 113-115 (lines=3) @@
110
111
    private function checkInvalidTokensAfterAT() : Result
112
    {
113
        if ($this->lexer->token['type'] === EmailLexer::S_DOT) {
114
            return new InvalidEmail(new DotAtStart(), $this->lexer->token['value']);
115
        }
116
        if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) {
117
            return new InvalidEmail(new ReasonDomainHyphened('After AT'), $this->lexer->token['value']);
118
        }
@@ 116-118 (lines=3) @@
113
        if ($this->lexer->token['type'] === EmailLexer::S_DOT) {
114
            return new InvalidEmail(new DotAtStart(), $this->lexer->token['value']);
115
        }
116
        if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) {
117
            return new InvalidEmail(new ReasonDomainHyphened('After AT'), $this->lexer->token['value']);
118
        }
119
        return new ValidEmail();
120
    }
121

EmailValidator/Parser/FoldingWhiteSpace.php 1 location

@@ 27-29 (lines=3) @@
24
25
        $this->checkCRLFInFWS();
26
27
        if ($this->lexer->token['type'] === EmailLexer::S_CR) {
28
            return new InvalidEmail(new CRNoLF(), $this->lexer->token['value']);
29
        }
30
31
        if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type']  !== EmailLexer::S_AT) {
32
            return new InvalidEmail(new AtextAfterCFWS(), $this->lexer->token['value']);