mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix hash_*() signatures (#4014)
Functions can return false when an invalid algorithm is supplied
This commit is contained in:
parent
1468a28273
commit
7ac6d2e5a4
@ -4251,18 +4251,18 @@ return [
|
||||
'HaruPage::stroke' => ['bool', 'close_path='=>'bool'],
|
||||
'HaruPage::textOut' => ['bool', 'x'=>'float', 'y'=>'float', 'text'=>'string'],
|
||||
'HaruPage::textRect' => ['bool', 'left'=>'float', 'top'=>'float', 'right'=>'float', 'bottom'=>'float', 'text'=>'string', 'align='=>'int'],
|
||||
'hash' => ['string', 'algo'=>'string', 'data'=>'string', 'raw_output='=>'bool'],
|
||||
'hash' => ['string|false', 'algo'=>'string', 'data'=>'string', 'raw_output='=>'bool'],
|
||||
'hash_algos' => ['list<string>'],
|
||||
'hash_copy' => ['HashContext', 'context'=>'HashContext|resource'],
|
||||
'hash_equals' => ['bool', 'known_string'=>'string', 'user_string'=>'string'],
|
||||
'hash_file' => ['string|false', 'algo'=>'string', 'filename'=>'string', 'raw_output='=>'bool'],
|
||||
'hash_final' => ['string', 'context'=>'HashContext|resource', 'raw_output='=>'bool'],
|
||||
'hash_hkdf' => ['string|false', 'algo'=>'string', 'ikm'=>'string', 'length='=>'int', 'info='=>'string', 'salt='=>'string'],
|
||||
'hash_hmac' => ['string', 'algo'=>'string', 'data'=>'string', 'key'=>'string', 'raw_output='=>'bool'],
|
||||
'hash_hmac' => ['string|false', 'algo'=>'string', 'data'=>'string', 'key'=>'string', 'raw_output='=>'bool'],
|
||||
'hash_hmac_algos' => ['list<string>'],
|
||||
'hash_hmac_file' => ['string', 'algo'=>'string', 'filename'=>'string', 'key'=>'string', 'raw_output='=>'bool'],
|
||||
'hash_init' => ['HashContext', 'algo'=>'string', 'options='=>'int', 'key='=>'string'],
|
||||
'hash_pbkdf2' => ['string', 'algo'=>'string', 'password'=>'string', 'salt'=>'string', 'iterations'=>'int', 'length='=>'int', 'raw_output='=>'bool'],
|
||||
'hash_hmac_file' => ['string|false', 'algo'=>'string', 'filename'=>'string', 'key'=>'string', 'raw_output='=>'bool'],
|
||||
'hash_init' => ['HashContext|false', 'algo'=>'string', 'options='=>'int', 'key='=>'string'],
|
||||
'hash_pbkdf2' => ['string|false', 'algo'=>'string', 'password'=>'string', 'salt'=>'string', 'iterations'=>'int', 'length='=>'int', 'raw_output='=>'bool'],
|
||||
'hash_update' => ['bool', 'context'=>'HashContext', 'data'=>'string'],
|
||||
'hash_update_file' => ['bool', 'context'=>'HashContext', 'filename'=>'string', 'scontext='=>'?HashContext'],
|
||||
'hash_update_stream' => ['int', 'context'=>'HashContext', 'handle'=>'resource', 'length='=>'int'],
|
||||
|
@ -873,7 +873,7 @@ class FunctionCallTest extends TestCase
|
||||
'<?php
|
||||
$h = hash_init("sha256");',
|
||||
[
|
||||
'$h' => 'HashContext',
|
||||
'$h' => 'HashContext|false',
|
||||
],
|
||||
[],
|
||||
'7.2',
|
||||
@ -882,7 +882,7 @@ class FunctionCallTest extends TestCase
|
||||
'<?php
|
||||
$h = hash_init("sha256");',
|
||||
[
|
||||
'$h' => 'HashContext',
|
||||
'$h' => 'HashContext|false',
|
||||
],
|
||||
[],
|
||||
'7.3',
|
||||
|
Loading…
x
Reference in New Issue
Block a user