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 a39b1f9 commit 2217791Copy full SHA for 2217791
src/HttpClient.php
@@ -16,16 +16,25 @@ class HttpClient
16
*/
17
protected static $client;
18
19
+ protected static $defaults = [
20
+ 'debug' => false,
21
+ 'verify' => true,
22
+ // You can set any number of default request options.
23
+ 'timeout' => 30,
24
+ ];
25
+
26
+ public static function setConfig(array $config)
27
+ {
28
+ self::$defaults = $config + self::$defaults;
29
+ }
30
31
/**
32
* @return Client
33
34
public static function getClient()
35
{
36
if (is_null(self::$client)) {
- self::$client = new Client([
- // You can set any number of default request options.
- 'timeout' => 30.0,
- ]);
37
+ self::$client = new Client(self::$defaults);
38
}
39
40
return self::$client;
0 commit comments