validation-bugsnag-email
This commit is contained in:
20
vendor/egulias/email-validator/src/Parser.php
vendored
20
vendor/egulias/email-validator/src/Parser.php
vendored
@@ -22,22 +22,22 @@ abstract class Parser
|
||||
/**
|
||||
* id-left "@" id-right
|
||||
*/
|
||||
abstract protected function parseRightFromAt() : Result;
|
||||
abstract protected function parseLeftFromAt() : Result;
|
||||
abstract protected function preLeftParsing() : Result;
|
||||
abstract protected function parseRightFromAt(): Result;
|
||||
abstract protected function parseLeftFromAt(): Result;
|
||||
abstract protected function preLeftParsing(): Result;
|
||||
|
||||
|
||||
public function __construct(EmailLexer $lexer)
|
||||
{
|
||||
$this->lexer = $lexer;
|
||||
$this->lexer = $lexer;
|
||||
}
|
||||
|
||||
public function parse(string $str) : Result
|
||||
public function parse(string $str): Result
|
||||
{
|
||||
$this->lexer->setInput($str);
|
||||
|
||||
if ($this->lexer->hasInvalidTokens()) {
|
||||
return new InvalidEmail(new ExpectingATEXT("Invalid tokens found"), $this->lexer->token["value"]);
|
||||
return new InvalidEmail(new ExpectingATEXT("Invalid tokens found"), $this->lexer->current->value);
|
||||
}
|
||||
|
||||
$preParsingResult = $this->preLeftParsing();
|
||||
@@ -51,7 +51,7 @@ abstract class Parser
|
||||
return $localPartResult;
|
||||
}
|
||||
|
||||
$domainPartResult = $this->parseRightFromAt();
|
||||
$domainPartResult = $this->parseRightFromAt();
|
||||
|
||||
if ($domainPartResult->isInvalid()) {
|
||||
return $domainPartResult;
|
||||
@@ -63,16 +63,16 @@ abstract class Parser
|
||||
/**
|
||||
* @return Warning\Warning[]
|
||||
*/
|
||||
public function getWarnings() : array
|
||||
public function getWarnings(): array
|
||||
{
|
||||
return $this->warnings;
|
||||
}
|
||||
|
||||
protected function hasAtToken() : bool
|
||||
protected function hasAtToken(): bool
|
||||
{
|
||||
$this->lexer->moveNext();
|
||||
$this->lexer->moveNext();
|
||||
|
||||
return $this->lexer->token['type'] !== EmailLexer::S_AT;
|
||||
return !$this->lexer->current->isA(EmailLexer::S_AT);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user