Code Duplication    Length = 6-7 lines in 3 locations

src/Egulias/EmailValidator/Parser/DomainPart.php 1 location

@@ 121-127 (lines=7) @@
118
                    $openedParenthesis--;
119
                }
120
            }
121
            if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) {
122
                if ($openedParenthesis === 0) {
123
                    throw new \InvalidArgumentException('ERR_UNOPENEDCOMMENT');
124
                } else {
125
                    $openedParenthesis--;
126
                }
127
            }
128
129
            $this->checkConsecutiveDots();
130
            $this->checkDomainPartExceptions($prev);

src/Egulias/EmailValidator/Parser/LocalPart.php 2 locations

@@ 17-22 (lines=6) @@
14
        $openedParenthesis = 0;
15
16
        while ($this->lexer->token['type'] !== EmailLexer::S_AT && null !== $this->lexer->token['type']) {
17
            if ($this->lexer->token['type'] === EmailLexer::S_DOT) {
18
                $previous = $this->lexer->getPrevious();
19
                if (null === $previous['type']) {
20
                    throw new \InvalidArgumentException('ERR_DOT_START');
21
                }
22
            }
23
24
            $closingQuote = $this->checkDQUOTE($closingQuote);
25
            if ($closingQuote && $parseDQuote) {
@@ 33-39 (lines=7) @@
30
                $this->parseComments();
31
                $openedParenthesis += $this->getOpenedParenthesis();
32
            }
33
            if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) {
34
                if ($openedParenthesis === 0) {
35
                    throw new \InvalidArgumentException('ERR_UNOPENEDCOMMENT');
36
                } else {
37
                    $openedParenthesis--;
38
                }
39
            }
40
41
            $this->checkConsecutiveDots();
42