-
Notifications
You must be signed in to change notification settings - Fork 675
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
[GH-11184] urlencode return an empty string when input is empty #11292
base: 6.x
Are you sure you want to change the base?
Conversation
@@ -50216,13 +50216,23 @@ | |||
), | |||
'rawurldecode' => | |||
array ( | |||
0 => 'string', | |||
'string' => 'string', | |||
0 => '\'\'', |
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.
I'm not used to the new callmap format yet but the way I understand it, this is supposed to be the return type. Shouldn't that be string?
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.
I'm not sure of the format either, what I'm trying to do is tell that if the input is an empty string (''
) the return type is an empty string too, and if the input is a non empty string, so is the output
I need to test it
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.
I guess that could work, even if we rarely go this precise in callmaps, however in this case you'll be missing the main case (you handle empty-string, non-empty-string but you should also handle any-string :p)
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.
right, a string can only be empty or non-empty, but that doesn't mean that we know that at the type level ! 🤦
I added back the any string variants. still need to test it. I wonder which variants Psalm will take if multiple could match. If they are tried in order I guess I'll have to put the any-string variant last. time to write some tests 👌
No description provided.