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 DomainComment implements CommentStrategy
11
class DomainComment implements CommentStrategy
12
{
12
{
13
    public function exitCondition(EmailLexer $lexer, int $openedParenthesis) : bool
13
    public function exitCondition(EmailLexer $lexer, int $openedParenthesis): bool
14
    {
14
    {
15
        if (($openedParenthesis === 0 && $lexer->isNextToken(EmailLexer::S_DOT))){ // || !$internalLexer->moveNext()) {
15
        if (($openedParenthesis === 0 && $lexer->isNextToken(EmailLexer::S_DOT))) { // || !$internalLexer->moveNext()) {
16
            return false;
16
            return false;
Zeile 17... Zeile 17...
17
        }
17
        }
18
 
18
 
Zeile 19... Zeile 19...
19
        return true;
19
        return true;
20
    }
20
    }
21
 
21
 
22
    public function endOfLoopValidations(EmailLexer $lexer) : Result
22
    public function endOfLoopValidations(EmailLexer $lexer): Result
23
    {
23
    {
24
        //test for end of string
24
        //test for end of string
25
        if (!$lexer->isNextToken(EmailLexer::S_DOT)) {
25
        if (!$lexer->isNextToken(EmailLexer::S_DOT)) {
26
            return new InvalidEmail(new ExpectingATEXT('DOT not found near CLOSEPARENTHESIS'), $lexer->token['value']);
26
            return new InvalidEmail(new ExpectingATEXT('DOT not found near CLOSEPARENTHESIS'), $lexer->current->value);
27
        }
27
        }
28
        //add warning
28
        //add warning