-
Notifications
You must be signed in to change notification settings - Fork 546
Narrow CURLOPT_SHARE accepting type #4611
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
| new ResourceType(), // PHP 7.x | ||
| new ObjectType('CurlShareHandle'), // since PHP 8.0 | ||
| new ObjectType('CurlSharePersistentHandle'), // since PHP 8.5 |
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.
we don't have access to PhpVersion at this point, therefore I hardcoded all possible types.
I think it doesn't really matter to narrow this further, because the values will be created by php-src builtin functions, so cannot be wrongly instantiated at runtime.
| return new UnionType([ | ||
| new ResourceType(), // PHP 7.x | ||
| new ObjectType('CurlShareHandle'), // since PHP 8.0 | ||
| new ObjectType('CurlSharePersistentHandle'), // since PHP 8.5 |
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.
You can ask PhpVersionStaticAccessor.
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.
adjusted, thanks
|
Thank you! |
since PHP8.5 there is also
CurlSharePersistentHandlecreated via curl_share_init_persistent