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
Update Curl is_resource() to work with PHP 8 CurlHandle and CurlMultiHandle objects #2715
Conversation
Could you make sure we test this on php8 too? |
PHP 8 is pending #2712 first, to avoid conflicts and to ensure the dependencies work on PHP 8. |
This needs rebasing. :) |
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'll be happy to merge this once you rebase it and the CI is green
Updates `is_resource()` calls for curl handlers to properly work with PHP 8's `\CurlHandle` and `\CurlMultiHandle` objects. See https://php.watch/versions/8.0/resource-CurlHandle PHPDoc comments are updated to indicate that the variable/property can be either a resource or a Curl object.
Thank you @Nyholm and @GrahamCampbell - I just force-pushed after rebasing from current |
Could you also make sure the CI is green? |
Both test failures are due to the PHP 8's changes in parameter types. I suppose both static analyzers infer the parameter types via Reflection. It wouldn't be ideal if we were to make psalm/phpstan suppress these errors, but that's the only approach I can think of for now. Even if were to run the static analyzers on PHP 8, it would now complain about the other type of parameters too. |
I will make changes in psalm/phpstan config files so it ignores the type mismatch false positives. |
I agree with you. Let's update the baselines for now. |
Thanks for updating the baselines, it wasn't something I had a lot of experience. |
I ran the following commands:
|
Thank you for your work and for the reviews |
I was about to suggest to add this to This could be unnecessary friction for newcomers, can't expect everyone to know the ins/outs of all the tools I guess, at least when it comes to handling things like updating the baseline. Any ideas how to make this easier? 🤔 |
Running these commands are rare. Newcomers will never run this. |
Updates
is_resource()
calls for curl handlers to properly work with PHP 8's\CurlHandle
and\CurlMultiHandle
objects.See https://php.watch/versions/8.0/resource-CurlHandle
PHPDoc comments are updated to indicate that the variable/property can be either a resource or a Curl object.
In PHP 8,
curl_close()
calls are no-op, and and explicitunset()
call is added to ensure the\CurlHandle
object is destroyed.This PR depends on #2714 (to enable tests).
Related: #2702
On manual/forced PHP 8 tests, there are two failures related to this repo (and 10 errors related to
promises
).This PR fixes the two failures related to this repo: