Code Duplication    Length = 3-5 lines in 5 locations

EmailValidator/Parser/LocalPart.php 2 locations

@@ 48-52 (lines=5) @@
45
46
            $this->checkConsecutiveDots();
47
48
            if ($this->lexer->token['type'] === EmailLexer::S_DOT &&
49
                $this->lexer->isNextToken(EmailLexer::S_AT)
50
            ) {
51
                throw new DotAtEnd();
52
            }
53
54
            $this->warnEscaping();
55
            $this->isInvalidToken($this->lexer->token, $closingQuote);
@@ 95-97 (lines=3) @@
92
                $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS();
93
                $setSpecialsWarning = false;
94
            }
95
            if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH && $this->lexer->isNextToken(EmailLexer::S_DQUOTE)) {
96
                $this->lexer->moveNext();
97
            }
98
99
            $this->lexer->moveNext();
100

EmailValidator/Parser/Parser.php 1 location

@@ 120-122 (lines=3) @@
117
118
    protected function checkConsecutiveDots()
119
    {
120
        if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) {
121
            throw new ConsecutiveDot();
122
        }
123
    }
124
125
    protected function isFWS()

EmailValidator/Parser/DomainPart.php 2 locations

@@ 331-333 (lines=3) @@
328
            throw new ExpectingATEXT();
329
        }
330
331
        if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) {
332
            throw new DomainHyphened();
333
        }
334
335
        if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH
336
            && $this->lexer->isNextToken(EmailLexer::GENERIC)) {
@@ 335-338 (lines=4) @@
332
            throw new DomainHyphened();
333
        }
334
335
        if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH
336
            && $this->lexer->isNextToken(EmailLexer::GENERIC)) {
337
            throw new ExpectingATEXT();
338
        }
339
    }
340
341
    protected function hasBrackets()