From da2e0c6df0ddd53186d7a556ac4dde85082ce162 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 19 Jan 2019 21:24:34 +0000 Subject: [PATCH] satisfying psalm for php 7.0 --- EmailValidator/Parser/DomainPart.php | 2 +- EmailValidator/Parser/LocalPart.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/EmailValidator/Parser/DomainPart.php b/EmailValidator/Parser/DomainPart.php index b39d53a..dfcf77a 100644 --- a/EmailValidator/Parser/DomainPart.php +++ b/EmailValidator/Parser/DomainPart.php @@ -180,7 +180,7 @@ protected function doParseDomainPart() $domain .= $this->lexer->token['value']; $this->lexer->moveNext(); - } while ($this->lexer->token); + } while ((bool) $this->lexer->token); return $domain; } diff --git a/EmailValidator/Parser/LocalPart.php b/EmailValidator/Parser/LocalPart.php index a7be490..458c0b0 100644 --- a/EmailValidator/Parser/LocalPart.php +++ b/EmailValidator/Parser/LocalPart.php @@ -21,7 +21,7 @@ public function parse($localPart) $closingQuote = false; $openedParenthesis = 0; - while ($this->lexer->token['type'] !== EmailLexer::S_AT && $this->lexer->token) { + while ($this->lexer->token['type'] !== EmailLexer::S_AT && (bool) $this->lexer->token) { if ($this->lexer->token['type'] === EmailLexer::S_DOT && !$this->lexer->getPrevious()) { throw new DotAtStart(); } @@ -89,7 +89,7 @@ protected function parseDoubleQuote() $this->lexer->moveNext(); - while ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE && $this->lexer->token) { + while ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE && (bool) $this->lexer->token) { $parseAgain = false; if (isset($special[$this->lexer->token['type']]) && $setSpecialsWarning) { $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS();