Skip to content
Permalink
Browse files

Update password function types for PHP 7.4 (#2396)

* Support NULL predefined constants

* Fix #2395 - update password_hash() and password_needs_rehash() types for PHP 7.4

* Change $fq_const_name check so it still uses isset
  • Loading branch information
ShiraNai7 authored and muglug committed Nov 29, 2019
1 parent a4e18f9 commit dc78e9c57ba58e21e7970451ca52314b398fc811
@@ -17,6 +17,7 @@
use Psalm\Issue\UndefinedConstant;
use Psalm\IssueBuffer;
use Psalm\Type;
use function array_key_exists;
use function implode;
use function strtolower;
use function explode;
@@ -102,7 +103,7 @@ public static function getGlobalConstType(
$predefined_constants = $codebase->config->getPredefinedConstants();
if (isset($predefined_constants[$fq_const_name])
if (($fq_const_name && isset($predefined_constants[$fq_const_name]))
|| isset($predefined_constants[$const_name])
) {
switch ($const_name) {
@@ -9356,9 +9356,9 @@
'parsekit_func_arginfo' => ['array', 'function'=>'mixed'],
'passthru' => ['void', 'command'=>'string', '&w_return_value='=>'int'],
'password_get_info' => ['array', 'hash'=>'string'],
'password_hash' => ['string|false|null', 'password'=>'string', 'algo'=>'int', 'options='=>'array'],
'password_hash' => ['string|null', 'password'=>'string', 'algo'=>'int|string|null', 'options='=>'array'],
'password_make_salt' => ['bool', 'password'=>'string', 'hash'=>'string'],
'password_needs_rehash' => ['bool', 'hash'=>'string', 'algo'=>'int', 'options='=>'array'],
'password_needs_rehash' => ['bool', 'hash'=>'string', 'algo'=>'int|string|null', 'options='=>'array'],
'password_verify' => ['bool', 'password'=>'string', 'hash'=>'string'],
'pathinfo' => ['array|string', 'path'=>'string', 'options='=>'int'],
'pclose' => ['int', 'fp'=>'resource'],
@@ -15,9 +15,11 @@
*/
return [
'new' => [
'password_hash' => ['string|null', 'password'=>'string', 'algo'=>'int', 'options='=>'array'],
'password_hash' => ['string|null', 'password'=>'string', 'algo'=>'int|string|null', 'options='=>'array'],
'password_needs_rehash' => ['bool', 'hash'=>'string', 'algo'=>'int|string|null', 'options='=>'array'],
],
'old' => [
'password_hash' => ['string|false', 'password'=>'string', 'algo'=>'int', 'options='=>'array'],
'password_needs_rehash' => ['bool', 'hash'=>'string', 'algo'=>'int', 'options='=>'array'],
]
];

0 comments on commit dc78e9c

Please sign in to comment.
You can’t perform that action at this time.