J7mbo / twitter-api-php

The simplest PHP Wrapper for Twitter API v1.1 calls
MIT License
1.82k stars 800 forks source link

Ability for performRequest() to overwrite CURL options #178

Closed lesterchan closed 8 years ago

lesterchan commented 8 years ago

My problem is that 10s timeout might be too short and there is no way to overwrite the default CURLOPT_TIMEOUT of 10s.

That is because the array is concatenated and hence the array on the left will take precedence over the argument passed in into performRequest()

By changing it to array_merge, I am able to overwrite it because now, the argument passed into performRequest() takes precedence.

Also fixes the PHPDoc of request() because the $data can be a string or array.

J7mbo commented 8 years ago

Hi, thanks for your PR! I know this is an old one now, I'm just going through and cleaning things up.

I agree with being able to overwrite. If you still want this merged, please feel free to make the PR into develop and ensure it passes all tests. Closing for now, cheers.