From 4c6c84c1e45f8577c8ae9395f1cbb81fefe02e0f Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 13 Aug 2019 14:13:34 +0200 Subject: [PATCH] Password hashing algorithm constants are mixed Types of these constants were changed from int to string|null in PHP 7.4 --- src/Analyser/Scope.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Analyser/Scope.php b/src/Analyser/Scope.php index a64f4622cc..f595686c1f 100644 --- a/src/Analyser/Scope.php +++ b/src/Analyser/Scope.php @@ -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();