8
8
9
9
class Guzzle
10
10
{
11
- const TIMEOUT = 10 .0 ;
11
+ const TIMEOUT = 15 .0 ;
12
12
const VERIFY = false ;
13
-
13
+
14
14
/** @var Client */
15
15
private static $ client = null ;
16
16
/** @var bool */
@@ -19,7 +19,7 @@ class Guzzle
19
19
private static $ environment = null ;
20
20
/** @var array */
21
21
private static $ options = [];
22
-
22
+
23
23
/**
24
24
* Set the Guzzle client
25
25
*/
@@ -31,7 +31,7 @@ private static function setClient()
31
31
'verify ' => self ::VERIFY ,
32
32
]);
33
33
}
34
-
34
+
35
35
public static function setEnvironment (string $ environment ): void
36
36
{
37
37
self ::$ environment = $ environment ;
@@ -40,7 +40,7 @@ public static function setEnvironment(string $environment): void
40
40
public static function query ($ method , $ apiEndpoint , $ options = [])
41
41
{
42
42
self ::setClient ();
43
-
43
+
44
44
// set XIVAPI key
45
45
if ($ key = getenv (Environment::XIVAPI_KEY )) {
46
46
$ options [RequestOptions::QUERY ]['private_key ' ] = $ key ;
@@ -51,7 +51,7 @@ public static function query($method, $apiEndpoint, $options = [])
51
51
$ value = is_array ($ value ) ? implode (', ' , $ value ) : $ value ;
52
52
$ options [RequestOptions::QUERY ][$ query ] = $ value ;
53
53
}
54
-
54
+
55
55
// allow async
56
56
if (self ::$ async ) {
57
57
return self ::$ client ->requestAsync ($ method , $ apiEndpoint , $ options );
@@ -61,17 +61,17 @@ public static function query($method, $apiEndpoint, $options = [])
61
61
self ::$ client ->request ($ method , $ apiEndpoint , $ options )->getBody ()
62
62
);
63
63
}
64
-
64
+
65
65
public static function setAsync ()
66
66
{
67
67
self ::$ async = true ;
68
68
}
69
-
69
+
70
70
public static function resetQuery ()
71
71
{
72
72
self ::$ options = [];
73
73
}
74
-
74
+
75
75
public static function setQuery (string $ query , $ value )
76
76
{
77
77
self ::$ options [$ query ] = $ value ;
0 commit comments