Code Duplication    Length = 3-3 lines in 5 locations

EmailValidator/Parser/Comment.php 2 locations

@@ 29-31 (lines=3) @@
26
            }
27
        }
28
29
        if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) {
30
            return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']);
31
        }
32
33
        $this->warnings[WarningComment::CODE] = new WarningComment();
34
        while (!$this->lexer->isNextToken(EmailLexer::S_AT)) {//!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) {
@@ 47-49 (lines=3) @@
44
45
        if($this->MopenedParenthesis >= 1) {
46
            return new InvalidEmail(new UnclosedComment(), $this->lexer->token['value']);
47
        } else if ($this->MopenedParenthesis < 0) {
48
            return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']);
49
        }
50
51
        if (!$this->lexer->isNextToken(EmailLexer::S_AT)) {
52
            return new InvalidEmail(new ExpectingATEXT('ATEX is not expected after closing comments'), $this->lexer->token['value']);

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']);

EmailValidator/Parser/DomainPart.php 2 locations

@@ 108-110 (lines=3) @@
105
106
    private function checkInvalidTokensAfterAT() : Result
107
    {
108
        if ($this->lexer->token['type'] === EmailLexer::S_DOT) {
109
            return new InvalidEmail(new ReasonDotAtStart(), $this->lexer->token['value']);
110
        }
111
        if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) {
112
            return new InvalidEmail(new ReasonDomainHyphened('After AT'), $this->lexer->token['value']);
113
        }
@@ 111-113 (lines=3) @@
108
        if ($this->lexer->token['type'] === EmailLexer::S_DOT) {
109
            return new InvalidEmail(new ReasonDotAtStart(), $this->lexer->token['value']);
110
        }
111
        if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) {
112
            return new InvalidEmail(new ReasonDomainHyphened('After AT'), $this->lexer->token['value']);
113
        }
114
        return new ValidEmail();
115
    }
116