-
Notifications
You must be signed in to change notification settings - Fork 506
More precise md5/sha1 return type #3541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request has been marked as ready for review. |
If I understand correctly You are using numeric-string in case only numbers are used ? So it's non-falsy&numeric&lowercase|non-falsy&lowercase I dont think there is a benefit to specify that sometimes it's a fully numeric string |
great feedback. I like the simplified version a lot more. I am not yet used to thinking about numbers to be lowercase strings ;). this also means we can do similar stuff in the |
resources/functionMap.php
Outdated
@@ -6403,8 +6403,8 @@ | |||
'mcrypt_module_open' => ['resource|false', 'cipher'=>'string', 'cipher_directory'=>'string', 'mode'=>'string', 'mode_directory'=>'string'], | |||
'mcrypt_module_self_test' => ['bool', 'algorithm'=>'string', 'lib_dir='=>'string'], | |||
'mcrypt_ofb' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'], | |||
'md5' => ['non-falsy-string', 'str'=>'string', 'raw_output='=>'bool'], | |||
'md5_file' => ['non-falsy-string|false', 'filename'=>'string', 'raw_output='=>'bool'], | |||
'md5' => ['(non-falsy-string&lowercase-string)', 'str'=>'string', 'raw_output='=>'bool'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the parentheses here.
Thank you! |
@staabm I'm not familiar with sha256 ; should the return type be updated too ? |
I am not familiar either. Tested a few inputs on https://emn178.github.io/online-tools/sha256.html and it seems you are right |
I'll do the PR as soon as I have confirmation this function really exists (cf my interrogation phpstan/phpstan#12048 (comment)) |
utilizing lowercase-string for this old school hashing functions
//cc @VincentLanglet