mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-08-28 19:19:31 +00:00
CRLFX2 and un used constants
This commit is contained in:
@@ -11,8 +11,6 @@ use Egulias\EmailValidator\InvalidEmail;
|
||||
*/
|
||||
class EmailValidator
|
||||
{
|
||||
const ERR_UNCLOSEDDOMLIT = 147;
|
||||
const ERR_FWS_CRLF_X2 = 148;
|
||||
const ERR_FWS_CRLF_END = 149;
|
||||
const ERR_CR_NO_LF = 150;
|
||||
const ERR_DEPREC_REACHED = 151;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Egulias\EmailValidator\Exception;
|
||||
|
||||
use Egulias\EmailValidator\InvalidEmail;
|
||||
|
||||
class CRLFX2 extends InvalidEmail
|
||||
{
|
||||
const CODE = 148
|
||||
const REASON = "Folding whitespace CR LF found twice";
|
||||
}
|
||||
@@ -6,6 +6,7 @@ use Egulias\EmailValidator\EmailLexer;
|
||||
use Egulias\EmailValidator\EmailValidator;
|
||||
use Egulias\EmailValidator\Exception\AtextAfterCFWS;
|
||||
use Egulias\EmailValidator\Exception\ConsecutiveDot;
|
||||
use Egulias\EmailValidator\Exception\CRLFX2;
|
||||
use Egulias\EmailValidator\Exception\ExpectedQPair;
|
||||
use Egulias\EmailValidator\Exception\ExpectingATEXT;
|
||||
use Egulias\EmailValidator\Exception\ExpectingCTEXT;
|
||||
@@ -188,7 +189,7 @@ abstract class Parser
|
||||
return;
|
||||
}
|
||||
if ($this->lexer->isNextToken(EmailLexer::CRLF)) {
|
||||
throw new \InvalidArgumentException("ERR_FWS_CRLF_X2");
|
||||
throw new CRLFX2();
|
||||
}
|
||||
if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) {
|
||||
throw new \InvalidArgumentException("ERR_FWS_CRLF_END");
|
||||
|
||||
Reference in New Issue
Block a user