+
Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Sep 10, 2022

validates all available curl constants when passed to curl_setopt.

implemeted everything listed on https://www.php.net/manual/en/function.curl-setopt.php - except a few callable-expecting types at the very end. these are a bit more complicated, therefore I left them out for now.

doing similar stuff for curl_setopt_array will be implemented in a followup PR.

closes phpstan/phpstan#7951

@staabm
Copy link
Contributor Author

staabm commented Sep 10, 2022

(lets finish all my other open non-draft PRs before finalizing/discussing this one here. I had a hour of free time.. ;))

@ondrejmirtes
Copy link
Member

Thank you for mapping out the types! However this doesn't need a new rule, just modifications to the function signature on the fly. This is already done for array_map and similar in https://github.com/phpstan/phpstan-src/blob/1.8.x/src/Reflection/ParametersAcceptorSelector.php.

When that's done, the existing rule (call to function parameters) will pick it up and report.

@ondrejmirtes
Copy link
Member

So nice, right? :) Please rebase and solve the conflict, thanks.

@ondrejmirtes ondrejmirtes changed the title implement CurlSetOptRule Change curl_setopt function signature based on 2nd arg Sep 20, 2022
@ondrejmirtes ondrejmirtes merged commit f4a93f6 into phpstan:1.8.x Sep 20, 2022
@ondrejmirtes
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

verify CURLOPT_SSL_VERIFYHOST value range
3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载