Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 150
Zeile 8... Zeile 8...
8
use Egulias\EmailValidator\Result\InvalidEmail;
8
use Egulias\EmailValidator\Result\InvalidEmail;
9
use Egulias\EmailValidator\Result\Reason\ExpectingATEXT;
9
use Egulias\EmailValidator\Result\Reason\ExpectingATEXT;
Zeile 10... Zeile 10...
10
 
10
 
11
class IDRightPart extends DomainPart
11
class IDRightPart extends DomainPart
12
{
12
{
13
    protected function validateTokens(bool $hasComments) : Result
13
    protected function validateTokens(bool $hasComments): Result
14
    {
14
    {
15
        $invalidDomainTokens = [
15
        $invalidDomainTokens = [
16
            EmailLexer::S_DQUOTE => true,
16
            EmailLexer::S_DQUOTE => true,
17
            EmailLexer::S_SQUOTE => true,
17
            EmailLexer::S_SQUOTE => true,
18
            EmailLexer::S_BACKTICK => true,
18
            EmailLexer::S_BACKTICK => true,
19
            EmailLexer::S_SEMICOLON => true,
19
            EmailLexer::S_SEMICOLON => true,
20
            EmailLexer::S_GREATERTHAN => true,
20
            EmailLexer::S_GREATERTHAN => true,
21
            EmailLexer::S_LOWERTHAN => true,
21
            EmailLexer::S_LOWERTHAN => true,
22
        ];
22
        ];
23
    
23
 
24
        if (isset($invalidDomainTokens[$this->lexer->token['type']])) {
24
        if (isset($invalidDomainTokens[$this->lexer->current->type])) {
25
            return new InvalidEmail(new ExpectingATEXT('Invalid token in domain: ' . $this->lexer->token['value']), $this->lexer->token['value']);
25
            return new InvalidEmail(new ExpectingATEXT('Invalid token in domain: ' . $this->lexer->current->value), $this->lexer->current->value);
26
        }
26
        }
27
        return new ValidEmail();
27
        return new ValidEmail();
28
    }
28
    }