Code Duplication    Length = 3-5 lines in 5 locations

src/Parser/LocalPart.php 2 locations

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

src/Parser/Parser.php 1 location

@@ 140-142 (lines=3) @@
137
138
    protected function checkConsecutiveDots()
139
    {
140
        if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) {
141
            throw new ConsecutiveDot();
142
        }
143
    }
144
145
    /**

src/Parser/DomainPart.php 2 locations

@@ 360-362 (lines=3) @@
357
            throw new ExpectingATEXT();
358
        }
359
360
        if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) {
361
            throw new DomainHyphened();
362
        }
363
364
        if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH
365
            && $this->lexer->isNextToken(EmailLexer::GENERIC)) {
@@ 364-367 (lines=4) @@
361
            throw new DomainHyphened();
362
        }
363
364
        if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH
365
            && $this->lexer->isNextToken(EmailLexer::GENERIC)) {
366
            throw new ExpectingATEXT();
367
        }
368
    }
369
370
    /**