privatefunctioncheckEndOfDomain(): Result { $prev = $this->lexer->getPrevious(); if($prev->isA(EmailLexer::S_DOT)){ returnnewInvalidEmail(newDotAtEnd(), $this->lexer->current->value); } if($prev->isA(EmailLexer::S_HYPHEN)){ returnnewInvalidEmail(newDomainHyphened('Hypen found at the end of the domain'), $prev->value); }