mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-25 18:43:22 +01:00
Minor cleanup
This commit is contained in:
parent
c4a4560c12
commit
58693edbf9
@ -273,14 +273,9 @@ class Client extends AbstractHasDispatcher implements ClientInterface
|
||||
$config = $this->getConfig()->getAll();
|
||||
|
||||
// Add any curl options to the request
|
||||
$curlOptions = CurlHandle::parseCurlConfig($config);
|
||||
$request->getCurlOptions()->merge($curlOptions);
|
||||
$request->getCurlOptions()->merge(CurlHandle::parseCurlConfig($config));
|
||||
|
||||
foreach ($config as $key => $value) {
|
||||
if ($key == 'curl.blacklist') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strpos($key, 'params.') === 0) {
|
||||
// Add request specific parameters to all requests (prefix with 'params.')
|
||||
$request->getParams()->set(substr($key, 7), $value);
|
||||
|
@ -427,7 +427,7 @@ class CurlHandle
|
||||
*
|
||||
* @param array|Collection $config The configuration we want to parse
|
||||
*
|
||||
* @return array|Collection
|
||||
* @return array
|
||||
*/
|
||||
public static function parseCurlConfig($config)
|
||||
{
|
||||
|
@ -281,12 +281,9 @@ abstract class AbstractCommand extends Collection implements CommandInterface
|
||||
$this->request->setHeader($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
// Add any curl options to the request
|
||||
$curlOptions = CurlHandle::parseCurlConfig($this->getAll());
|
||||
// Override globals
|
||||
foreach ($curlOptions as $key => $value) {
|
||||
$this->request->getCurlOptions()->set($key, $value);
|
||||
}
|
||||
$this->request->getCurlOptions()->merge(CurlHandle::parseCurlConfig($this->getAll()));
|
||||
}
|
||||
|
||||
return $this->getRequest();
|
||||
|
Loading…
x
Reference in New Issue
Block a user