Skip to content

Commit 1f837f9

Browse files
author
Openset
committed
Add: getClient
1 parent b9feced commit 1f837f9

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/HttpClient.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22

33
namespace Openset;
44

5+
use GuzzleHttp\Client;
6+
57
class HttpClient
68
{
9+
protected static $client;
10+
11+
public static function getClient()
12+
{
13+
if (is_null(self::$client)) {
14+
self::$client = new Client([
15+
// You can set any number of default request options.
16+
'timeout' => 30.0,
17+
]);
18+
}
19+
20+
return self::$client;
21+
}
722

8-
}
23+
}

0 commit comments

Comments
 (0)