Code Duplication    Length = 9-10 lines in 2 locations

src/Parser/DomainPart.php 1 location

@@ 166-175 (lines=10) @@
163
                return $notAllowedChars;
164
            }
165
166
            if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS || 
167
                $this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS ) {
168
                $hasComments = true;
169
                $commentsResult = $this->parseComments();
170
171
                //Invalid comment parsing
172
                if($commentsResult->isInvalid()) {
173
                    return $commentsResult;
174
                }
175
            }
176
177
            $dotsResult = $this->checkConsecutiveDots();
178
            if ($dotsResult->isInvalid()) {

src/Parser/LocalPart.php 1 location

@@ 42-50 (lines=9) @@
39
                }
40
            }
41
42
            if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS || 
43
                $this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS ) {
44
                $commentsResult = $this->parseComments();
45
46
                //Invalid comment parsing
47
                if($commentsResult->isInvalid()) {
48
                    return $commentsResult;
49
                }
50
            }
51
52
            if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) {
53
                return new InvalidEmail(new ConsecutiveDot(), $this->lexer->token['value']);