mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-08-28 11:07:55 +00:00
[WIP] - ordering classes
This commit is contained in:
@@ -35,7 +35,6 @@ class EmailValidator
|
||||
const ERR_FWS_CRLF_END = 149;
|
||||
const ERR_CR_NO_LF = 150;
|
||||
const ERR_DEPREC_REACHED = 151;
|
||||
|
||||
const RFC5321_TLD = 9;
|
||||
const RFC5321_TLDNUMERIC = 10;
|
||||
const RFC5321_QUOTEDSTRING = 11;
|
||||
@@ -70,7 +69,6 @@ class EmailValidator
|
||||
protected $warnings = array();
|
||||
protected $error;
|
||||
protected $threshold = 255;
|
||||
protected $emailParts = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -81,7 +79,6 @@ class EmailValidator
|
||||
{
|
||||
try {
|
||||
$this->parser->parse((string)$email);
|
||||
$this->emailParts = explode('@', $email);
|
||||
$this->warnings = $this->parser->getWarnings();
|
||||
} catch (\Exception $e) {
|
||||
$rClass = new \ReflectionClass($this);
|
||||
@@ -93,6 +90,7 @@ class EmailValidator
|
||||
if ($checkDNS) {
|
||||
$dns = $this->checkDNS();
|
||||
}
|
||||
|
||||
if ($this->hasWarnings() && ((int) max($this->warnings) > $this->threshold)) {
|
||||
$this->error = self::ERR_DEPREC_REACHED;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Egulias\EmailValidator\Parser;
|
||||
|
||||
use Egulias\EmailValidator\EmailLexer;
|
||||
use Egulias\EmailValidator\Parser;
|
||||
use Egulias\EmailValidator\Parser\Parser;
|
||||
use Egulias\EmailValidator\EmailValidator;
|
||||
|
||||
class DomainPart extends Parser
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Egulias\EmailValidator\Parser;
|
||||
|
||||
use Egulias\EmailValidator\EmailLexer;
|
||||
use Egulias\EmailValidator\Parser;
|
||||
use Egulias\EmailValidator\Parser\Parser;
|
||||
use Egulias\EmailValidator\EmailValidator;
|
||||
|
||||
/**
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Egulias\EmailValidator\Parser;
|
||||
|
||||
namespace Egulias\EmailValidator;
|
||||
use Egulias\EmailValidator\EmailLexer;
|
||||
use Egulias\EmailValidator\EmailValidator;
|
||||
|
||||
abstract class Parser
|
||||
{
|
||||
Reference in New Issue
Block a user