| @@ 61-63 (lines=3) @@ | ||
| 58 | if($validQuotedString->isInvalid()) return $validQuotedString; |
|
| 59 | } |
|
| 60 | ||
| 61 | if (!$this->lexer->isNextToken(EmailLexer::S_AT) && $prev['type'] !== EmailLexer::S_BACKSLASH) { |
|
| 62 | return new InvalidEmail(new ExpectingATEXT("Expecting ATEXT between DQUOTE"), $this->lexer->token['value']); |
|
| 63 | } |
|
| 64 | ||
| 65 | return new ValidEmail(); |
|
| 66 | } |
|
| @@ 72-75 (lines=4) @@ | ||
| 69 | { |
|
| 70 | $previous = $this->lexer->getPrevious(); |
|
| 71 | ||
| 72 | if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] === EmailLexer::GENERIC) { |
|
| 73 | $description = 'https://tools.ietf.org/html/rfc5322#section-3.2.4 - quoted string should be a unit'; |
|
| 74 | return new InvalidEmail(new ExpectingATEXT($description), $this->lexer->token['value']); |
|
| 75 | } |
|
| 76 | ||
| 77 | try { |
|
| 78 | $this->lexer->find(EmailLexer::S_DQUOTE); |
|
| @@ 32-34 (lines=3) @@ | ||
| 29 | return new InvalidEmail(new CRNoLF(), $this->lexer->token['value']); |
|
| 30 | } |
|
| 31 | ||
| 32 | if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] !== EmailLexer::S_AT) { |
|
| 33 | return new InvalidEmail(new AtextAfterCFWS(), $this->lexer->token['value']); |
|
| 34 | } |
|
| 35 | ||
| 36 | if ($this->lexer->token['type'] === EmailLexer::S_LF || $this->lexer->token['type'] === EmailLexer::C_NUL) { |
|
| 37 | return new InvalidEmail(new ExpectingCTEXT(), $this->lexer->token['value']); |
|