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
Fix type for CURLOPT_POSTFIELDS #1777
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -515,6 +515,10 @@ private static function getCurlOptValueType(int $curlOpt): ?Type | |
return new UnionType([new ConstantIntegerType(0), new ConstantIntegerType(2)]); | ||
} | ||
|
||
if (defined('CURLOPT_POSTFIELDS') && $curlOpt === CURLOPT_SSL_VERIFYHOST) { | ||
return new UnionType([new StringType(), new ArrayType(new MixedType(), new MixedType())]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the array key/value types be more precise then mixed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I dunno. Doc say
So, value can be string, arrays, but maybe others things... And keys, it's string. But I'm kinda worried bout the int keys.
which could be considered as '0=foo&1=bar'. (since '0' key would still be casted to int...) |
||
} | ||
|
||
$boolConstants = [ | ||
'CURLOPT_AUTOREFERER', | ||
'CURLOPT_COOKIESESSION', | ||
|
@@ -646,7 +650,6 @@ private static function getCurlOptValueType(int $curlOpt): ?Type | |
'CURLOPT_KRB4LEVEL', | ||
'CURLOPT_LOGIN_OPTIONS', | ||
'CURLOPT_PINNEDPUBLICKEY', | ||
'CURLOPT_POSTFIELDS', | ||
'CURLOPT_PRIVATE', | ||
'CURLOPT_PRE_PROXY', | ||
'CURLOPT_PROXY', | ||
|
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.
Copy paste error most likely here. Would be nice to verify also when a wrong type is passed when setting
CURLOPT_POSTFIELDS
.