Update functionMaps#2699
Update functionMaps#2699ondrejmirtes merged 4 commits intophpstan:1.10.xfrom zonuexe:update/function_maps
Conversation
resources/functionMap.php
Outdated
There was a problem hiding this comment.
This function always returns non-empty-list and neither '0' nor ''. https://www.php.net/manual/en/function.hash-algos.php
resources/functionMap.php
Outdated
There was a problem hiding this comment.
This function always returns non-empty-list and neither '0' nor ''.
https://www.php.net/manual/en/function.hash-hmac-algos.php
resources/functionMap.php
Outdated
There was a problem hiding this comment.
MD5 and SHA1 are fixed lengths, so they will never return either '0' or ''.
There was a problem hiding this comment.
This function sets only 0 and 1 in the variable by reference.
https://github.com/php/php-src/blob/php-8.2.5/ext/standard/file.c#L212-L221
There was a problem hiding this comment.
$length = 0 means the default length, so an empty string will never be returned.
|
Hi, this looks good but I can't merge it because some tests are still failing. |
|
Sorry, I'll fix it tonight (UTC+9). |
resources/functionMap.php
Outdated
There was a problem hiding this comment.
Do this kind of changes actually bring any value at all? I feel like it's counterproductive and might lead to possible mistakes if something is overlooked (i.e. are we 100% sure there can be no falsy string in that list, ever under all circumstances and system setups?).
|
Please fix the build https://github.com/phpstan/phpstan-src/actions/runs/6711125445/job/18237809504 |
| 'session_is_registered' => ['bool', 'name'=>'string'], | ||
| 'session_module_name' => ['string|false', 'newname='=>'string'], | ||
| 'session_name' => ['string|false', 'newname='=>'string'], | ||
| 'session_name' => ['non-falsy-string|false', 'newname='=>'string'], |
There was a problem hiding this comment.
Both '0' and '' are not valid session names.
| 'session_encode' => ['string|false'], | ||
| 'session_gc' => ['int|false'], | ||
| 'session_get_cookie_params' => ['array'], | ||
| 'session_get_cookie_params' => ['array{lifetime:0|positive-int,path:non-falsy-string,domain:string,secure:bool,httponly:bool,samesite:string}'], |
There was a problem hiding this comment.
|
@ondrejmirtes Sorry to keep you waiting, I've pushed the fix. |
|
Thank you. |
No description provided.