php-http / curl-client

cURL client
http://httplug.io
MIT License
443 stars 28 forks source link

Cast CURL constants to string that cause a InvalidArgumentException #63

Closed codedmonkey closed 4 years ago

codedmonkey commented 4 years ago

Followup on https://github.com/php-http/curl-client/pull/62

After some quick testing, I noticed some inconsistencies because the Symfony source code doesn't use strict typing. So when you pass the CURL constants as array keys, it will be converted to strings by the OptionsResolver itself.

# This works
        $resolver->setDefaults(
            [
                CURLOPT_HEADER => false
            ]
        );

# This doesn't work
        $resolver->setDefault(CURLOPT_HEADER, false);