Code Duplication    Length = 3-5 lines in 3 locations

EmailValidator/Parser/FoldingWhiteSpace.php 1 location

@@ 35-37 (lines=3) @@
32
            return new InvalidEmail(new AtextAfterCFWS(), $this->lexer->token['value']);
33
        }
34
35
        if ($this->lexer->token['type'] === EmailLexer::S_LF || $this->lexer->token['type'] === EmailLexer::C_NUL) {
36
            return new InvalidEmail(new ExpectingCTEXT(), $this->lexer->token['value']);
37
        }
38
39
        if ($this->lexer->isNextToken(EmailLexer::S_AT) || $previous['type']  === EmailLexer::S_AT) {
40
            $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt();

EmailValidator/Parser/LocalPart.php 2 locations

@@ 60-62 (lines=3) @@
57
                }
58
            }
59
60
            if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) {
61
                return new InvalidEmail(new ConsecutiveDot(), $this->lexer->token['value']);
62
            }
63
64
            if ($this->lexer->token['type'] === EmailLexer::S_DOT &&
65
                $this->lexer->isNextToken(EmailLexer::S_AT)
@@ 64-68 (lines=5) @@
61
                return new InvalidEmail(new ConsecutiveDot(), $this->lexer->token['value']);
62
            }
63
64
            if ($this->lexer->token['type'] === EmailLexer::S_DOT &&
65
                $this->lexer->isNextToken(EmailLexer::S_AT)
66
            ) {
67
                return new InvalidEmail(new DotAtEnd(), $this->lexer->token['value']);
68
            }
69
70
            $resultEscaping = $this->validateEscaping();
71
            if ($resultEscaping->isInvalid()) {