Code Duplication    Length = 3-5 lines in 4 locations

src/Egulias/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()

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

@@ 308-310 (lines=3) @@
305
            throw new ExpectingATEXT();
306
        }
307
308
        if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) {
309
            throw new DomainHyphened();
310
        }
311
312
        if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH
313
            && $this->lexer->isNextToken(EmailLexer::GENERIC)) {
@@ 312-315 (lines=4) @@
309
            throw new DomainHyphened();
310
        }
311
312
        if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH
313
            && $this->lexer->isNextToken(EmailLexer::GENERIC)) {
314
            throw new ExpectingATEXT();
315
        }
316
    }
317
318
    protected function hasBrackets()

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

@@ 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);