1
0

first commit

This commit is contained in:
Daniel Tartavel
2021-10-14 17:58:21 +02:00
parent e5fe464cbc
commit df07673a67
327 changed files with 44407 additions and 0 deletions

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class AddressLiteral extends Warning
{
const CODE = 12;
public function __construct()
{
$this->message = 'Address literal in domain part';
$this->rfcNumber = 5321;
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Egulias\EmailValidator\Warning;
class CFWSNearAt extends Warning
{
const CODE = 49;
public function __construct()
{
$this->message = "Deprecated folding white space near @";
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Egulias\EmailValidator\Warning;
class CFWSWithFWS extends Warning
{
const CODE = 18;
public function __construct()
{
$this->message = 'Folding whites space followed by folding white space';
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Egulias\EmailValidator\Warning;
class Comment extends Warning
{
const CODE = 17;
public function __construct()
{
$this->message = "Comments found in this email";
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Egulias\EmailValidator\Warning;
class DeprecatedComment extends Warning
{
const CODE = 37;
public function __construct()
{
$this->message = 'Deprecated comments';
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class DomainLiteral extends Warning
{
const CODE = 70;
public function __construct()
{
$this->message = 'Domain Literal';
$this->rfcNumber = 5322;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class DomainTooLong extends Warning
{
const CODE = 255;
public function __construct()
{
$this->message = 'Domain is too long, exceeds 255 chars';
$this->rfcNumber = 5322;
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace Egulias\EmailValidator\Warning;
use Egulias\EmailValidator\EmailParser;
class EmailTooLong extends Warning
{
const CODE = 66;
public function __construct()
{
$this->message = 'Email is too long, exceeds ' . EmailParser::EMAIL_MAX_LENGTH;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class IPV6BadChar extends Warning
{
const CODE = 74;
public function __construct()
{
$this->message = 'Bad char in IPV6 domain literal';
$this->rfcNumber = 5322;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class IPV6ColonEnd extends Warning
{
const CODE = 77;
public function __construct()
{
$this->message = ':: found at the end of the domain literal';
$this->rfcNumber = 5322;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class IPV6ColonStart extends Warning
{
const CODE = 76;
public function __construct()
{
$this->message = ':: found at the start of the domain literal';
$this->rfcNumber = 5322;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class IPV6Deprecated extends Warning
{
const CODE = 13;
public function __construct()
{
$this->message = 'Deprecated form of IPV6';
$this->rfcNumber = 5321;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class IPV6DoubleColon extends Warning
{
const CODE = 73;
public function __construct()
{
$this->message = 'Double colon found after IPV6 tag';
$this->rfcNumber = 5322;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class IPV6GroupCount extends Warning
{
const CODE = 72;
public function __construct()
{
$this->message = 'Group count is not IPV6 valid';
$this->rfcNumber = 5322;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class IPV6MaxGroups extends Warning
{
const CODE = 75;
public function __construct()
{
$this->message = 'Reached the maximum number of IPV6 groups allowed';
$this->rfcNumber = 5321;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class LabelTooLong extends Warning
{
const CODE = 63;
public function __construct()
{
$this->message = 'Label too long';
$this->rfcNumber = 5322;
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace Egulias\EmailValidator\Warning;
class LocalTooLong extends Warning
{
const CODE = 64;
const LOCAL_PART_LENGTH = 64;
public function __construct()
{
$this->message = 'Local part is too long, exceeds 64 chars (octets)';
$this->rfcNumber = 5322;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class NoDNSMXRecord extends Warning
{
const CODE = 6;
public function __construct()
{
$this->message = 'No MX DSN record was found for this email';
$this->rfcNumber = 5321;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Egulias\EmailValidator\Warning;
class ObsoleteDTEXT extends Warning
{
const CODE = 71;
public function __construct()
{
$this->rfcNumber = 5322;
$this->message = 'Obsolete DTEXT in domain literal';
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Egulias\EmailValidator\Warning;
class QuotedPart extends Warning
{
const CODE = 36;
public function __construct($prevToken, $postToken)
{
$this->message = "Deprecated Quoted String found between $prevToken and $postToken";
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Egulias\EmailValidator\Warning;
class QuotedString extends Warning
{
const CODE = 11;
public function __construct($prevToken, $postToken)
{
$this->message = "Quoted String found between $prevToken and $postToken";
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Egulias\EmailValidator\Warning;
class TLD extends Warning
{
const CODE = 9;
public function __construct()
{
$this->message = "RFC5321, TLD";
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace Egulias\EmailValidator\Warning;
abstract class Warning
{
const CODE = 0;
protected $message;
protected $rfcNumber;
public function message()
{
return $this->message;
}
public function code()
{
return self::CODE;
}
public function RFCNumber()
{
return $this->rfcNumber;
}
public function __toString()
{
return $this->message() . " rfc: " . $this->rfcNumber . "interal code: " . static::CODE;
}
}