Skip to content

Conversation

codedmonkey
Copy link
Contributor

Followup on #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);

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason why the array works might also be the weird way of how php handles array keys (autoconverting strings to integer when they look like they could be numeric)

anyway, the fix looks right, thanks!

@dbu dbu merged commit 4336b53 into php-http:master Nov 25, 2019
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