Use php nullsafe operator to fix type issues

This commit is contained in:
Bastien Wermeille
2022-12-18 22:04:37 +01:00
parent 0841364b8d
commit f9e4bc5835
16 changed files with 101 additions and 103 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ class IDRightPart extends DomainPart
EmailLexer::S_LOWERTHAN => true,
];
if (isset($invalidDomainTokens[$this->lexer->token->type])) {
return new InvalidEmail(new ExpectingATEXT('Invalid token in domain: ' . $this->lexer->token->value), $this->lexer->token->value);
if (isset($invalidDomainTokens[$this->lexer->token?->type])) {
return new InvalidEmail(new ExpectingATEXT('Invalid token in domain: ' . $this->lexer->token?->value), $this->lexer->token?->value);
}
return new ValidEmail();
}