Psaml run 1

This commit is contained in:
Eduardo Gulias Davis
2020-09-12 16:55:59 +02:00
parent afd6bcba6a
commit b76c116718
7 changed files with 23 additions and 11 deletions
+4 -4
View File
@@ -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()
{
+8 -2
View File
@@ -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)
+2 -2
View File
@@ -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
{
+4 -1
View File
@@ -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(
+3
View File
@@ -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) {
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -21,7 +21,7 @@ interface EmailValidation
/**
* Returns the validation error.
*
* @return InvalidEmail|null
* @return InvalidEmail
*/
public function getError() : ?InvalidEmail;