We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b178535 commit cfa3f26Copy full SHA for cfa3f26
ClientFactory/CurlFactory.php
@@ -40,6 +40,18 @@ public function createClient(array $config = [])
40
throw new \LogicException('To use the Curl client you need to install the "php-http/curl-client" package.');
41
}
42
43
+ // Try to resolve curl constant names
44
+ foreach ($config as $key => $value) {
45
+ // If the value starts with 'CURL' we assume it is a reference to a constant.
46
+ if (strpos($key, 'CURL') === 0) {
47
+ $contantValue = constant($key);
48
+ if ($contantValue !== null) {
49
+ unset($config[$key]);
50
+ $config[$contantValue] = $value;
51
+ }
52
53
54
+
55
return new Client($this->messageFactory, $this->streamFactory, $config);
56
57
0 commit comments