Skip to content

Create the cURL handle at a single place to avoid code redundancy#99

Merged
msyk merged 1 commit intomsyk:masterfrom
patacra:master
Sep 10, 2024
Merged

Create the cURL handle at a single place to avoid code redundancy#99
msyk merged 1 commit intomsyk:masterfrom
patacra:master

Conversation

@patacra
Copy link
Copy Markdown
Contributor

@patacra patacra commented Sep 10, 2024

I noticed later that curl_init() was called at several places, so my fix to do the SSL certificate check by using the system root certificates didn't work for all cases. To avoid code duplication, I added a private function to create the cURL handle at a single place.

In the same time, I tried removing some warnings from SonarLint, such as else if which should be replaced by elseif.

Also tried to improve all the type declarations for some methods. About this topic, I don't know what is best to do, but I think that optional parameters should use null instead of false. But maybe some users may have used false in their calls, so to avoid breaking updates, it might be interesting to accept false or null and test if the parameter is the expected type, such as an array or a string or whatever else.

…place `else if` by `elseif`, try to improve function signatures with typing.
@msyk
Copy link
Copy Markdown
Owner

msyk commented Sep 10, 2024

Thanks for a lot of modifications. I think it's better to use null instead of false, but the compatibility rises as the new issue. You resolved my worry about.

@msyk msyk merged commit de7f6c4 into msyk:master Sep 10, 2024
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.

2 participants