Code Duplication    Length = 9-10 lines in 2 locations

src/Parser/LocalPart.php 1 location

@@ 51-59 (lines=9) @@
48
                }
49
            }
50
51
            if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS || 
52
                $this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS ) {
53
                $commentsResult = $this->parseComments();
54
55
                //Invalid comment parsing
56
                if($commentsResult->isInvalid()) {
57
                    return $commentsResult;
58
                }
59
            }
60
61
            if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) {
62
                return new InvalidEmail(new ConsecutiveDot(), $this->lexer->token['value']);

src/Parser/DomainPart.php 1 location

@@ 156-165 (lines=10) @@
153
                return $notAllowedChars;
154
            }
155
156
            if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS || 
157
                $this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS ) {
158
                $hasComments = true;
159
                $commentsResult = $this->parseComments();
160
161
                //Invalid comment parsing
162
                if($commentsResult->isInvalid()) {
163
                    return $commentsResult;
164
                }
165
            }
166
167
            $dotsResult = $this->checkConsecutiveDots();
168
            if ($dotsResult->isInvalid()) {