Code Duplication    Length = 7-8 lines in 2 locations

src/Parser/DomainPart.php 1 location

@@ 153-159 (lines=7) @@
150
                return $exceptionsResult;
151
            }
152
153
            if ($this->lexer->token['type'] === EmailLexer::S_OPENBRACKET) {
154
                $literalResult = $this->parseDomainLiteral();
155
                //Invalid literal parsing
156
                if($literalResult->isInvalid()) {
157
                    return $literalResult;
158
                }
159
            }
160
161
            $this->checkLabelLength($prev);
162

src/Parser/LocalPart.php 1 location

@@ 38-45 (lines=8) @@
35
                return new InvalidEmail(new DotAtStart(), $this->lexer->token['value']);
36
            }
37
38
            if ($this->lexer->token['type'] === EmailLexer::S_DQUOTE) {
39
                $dquoteParsingResult = $this->parseDoubleQuote();
40
41
                //Invalid double quote parsing
42
                if($dquoteParsingResult->isInvalid()) {
43
                    return $dquoteParsingResult;
44
                }
45
            }
46
47
            if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS || 
48
                $this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS ) {