mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-08-19 00:20:29 +00:00
Psaml run 1
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Egulias\EmailValidator;
|
||||
|
||||
use Egulias\EmailValidator\Exception\InvalidEmail;
|
||||
use Egulias\EmailValidator\Result\InvalidEmail;
|
||||
use Egulias\EmailValidator\Validation\EmailValidation;
|
||||
|
||||
class EmailValidator
|
||||
@@ -15,12 +15,12 @@ class EmailValidator
|
||||
/**
|
||||
* @var Warning\Warning[]
|
||||
*/
|
||||
protected $warnings = [];
|
||||
private $warnings = [];
|
||||
|
||||
/**
|
||||
* @var InvalidEmail|null
|
||||
* @var ?InvalidEmail
|
||||
*/
|
||||
protected $error;
|
||||
private $error;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -13,8 +13,14 @@ use Egulias\EmailValidator\Warning\Comment as WarningComment;
|
||||
|
||||
class Comment extends Parser
|
||||
{
|
||||
//change to private when removed from parent parser
|
||||
protected $openedParenthesis = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $openedParenthesis = 0;
|
||||
|
||||
/**
|
||||
* @var CommentStrategy
|
||||
*/
|
||||
private $commentStrategy;
|
||||
|
||||
public function __construct(EmailLexer $lexer, CommentStrategy $commentStrategy)
|
||||
|
||||
@@ -138,7 +138,7 @@ class DomainLiteral extends Parser
|
||||
}
|
||||
}
|
||||
|
||||
public function convertIPv4ToIPv6($addressLiteralIPv4) : string
|
||||
public function convertIPv4ToIPv6(string $addressLiteralIPv4) : string
|
||||
{
|
||||
$matchesIP = array();
|
||||
$IPv4Match = preg_match(
|
||||
@@ -162,7 +162,7 @@ class DomainLiteral extends Parser
|
||||
/**
|
||||
* @param string $addressLiteral
|
||||
*
|
||||
* @return string
|
||||
* @return bool
|
||||
*/
|
||||
protected function checkIPV4Tag($addressLiteral) : bool
|
||||
{
|
||||
|
||||
@@ -111,7 +111,7 @@ class DomainPart extends Parser
|
||||
return $this->domainPart;
|
||||
}
|
||||
|
||||
protected function parseComments()
|
||||
protected function parseComments(): Result
|
||||
{
|
||||
$commentParser = new Comment($this->lexer, new DomainComment());
|
||||
$result = $commentParser->parse();
|
||||
@@ -200,6 +200,9 @@ class DomainPart extends Parser
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return InvalidEmail|ValidEmail
|
||||
*/
|
||||
protected function checkDomainPartExceptions(array $prev)
|
||||
{
|
||||
$invalidDomainTokens = array(
|
||||
|
||||
@@ -46,6 +46,9 @@ class FoldingWhiteSpace extends Parser
|
||||
return new ValidEmail();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return InvalidEmail|ValidEmail|null
|
||||
*/
|
||||
protected function checkCRLFInFWS()
|
||||
{
|
||||
if ($this->lexer->token['type'] !== EmailLexer::CRLF) {
|
||||
|
||||
@@ -114,7 +114,7 @@ class LocalPart extends Parser
|
||||
return $parseAgain;
|
||||
}
|
||||
|
||||
private function parseComments()
|
||||
private function parseComments(): Result
|
||||
{
|
||||
$commentParser = new Comment($this->lexer, new LocalComment());
|
||||
$result = $commentParser->parse();
|
||||
|
||||
@@ -21,7 +21,7 @@ interface EmailValidation
|
||||
/**
|
||||
* Returns the validation error.
|
||||
*
|
||||
* @return InvalidEmail|null
|
||||
* @return InvalidEmail
|
||||
*/
|
||||
public function getError() : ?InvalidEmail;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user