Fix CURLOPT_POSTFIELDS param type#1782
Merged
ondrejmirtes merged 2 commits intophpstan:1.8.xfrom Oct 2, 2022
Merged
Conversation
18d7317 to
e515b25
Compare
Member
|
Hi Ahmed :) There's already #1777 but I can't merge it because of coding standards and requirements checker failures. So yours PR might be correct sooner and might win the race :) Your PR passes but is missing any tests - it'd be nice to add tests for cases when it should pass, and at least one test for the case when the rule should report an error. Also please base the PR on 1.8.x so it can be released sooner. |
Contributor
Author
|
Thanks for pointing out the other PR. I did not know about it because it's not mentioned in the issue. I've added the tests and changed that base 1.8.x. I assume it's ready to be merged in case the other one is not. |
3e8df38 to
576edf0
Compare
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Ondrej,
CURLOPT_POSTFIELDSaccepts string or array but PHPStan reports a type error if the value is not a stringhttps://phpstan.org/r/db599e65-dfae-4e85-90bc-6bc96feadf96
I'm not sure about
TypeCombinator::unionbut it's what I was able to find to achieve the fix.closes phpstan/phpstan#8053.
Thanks.