Skip to content

Commit

Permalink
satisfying psalm for php 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SignpostMarv committed Jan 19, 2019
1 parent 210ac3c commit da2e0c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion EmailValidator/Parser/DomainPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions EmailValidator/Parser/LocalPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit da2e0c6

Please sign in to comment.