Skip to content

Commit

Permalink
Password hashing algorithm constants are mixed
Browse files Browse the repository at this point in the history
Types of these constants were changed from int to string|null in PHP 7.4
  • Loading branch information
ondrejmirtes committed Aug 13, 2019
1 parent a3bcc58 commit 4c6c84c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Analyser/Scope.php
Expand Up @@ -1285,6 +1285,15 @@ private function resolveType(Expr $node): Type
return new IntegerType();
}

if (in_array($resolvedConstantName, [
'PASSWORD_DEFAULT',
'PASSWORD_BCRYPT',
'PASSWORD_ARGON2I',
'PASSWORD_ARGON2ID',
], true)) {
return new MixedType();
}

$constantType = $this->getTypeFromValue(constant($resolvedConstantName));
if ($constantType instanceof ConstantType && in_array($resolvedConstantName, $this->dynamicConstantNames, true)) {
return $constantType->generalize();
Expand Down

0 comments on commit 4c6c84c

Please sign in to comment.