@@ -54,20 +54,21 @@ class Client
54
54
/**
55
55
* Initialize the client
56
56
*
57
- * @param string $host the base url (e.g. https://api.sendgrid.com)
58
- * @param array $headers global request headers
59
- * @param string $version api version (configurable)
60
- * @param array $path holds the segments of the url path
57
+ * @param string $host the base url (e.g. https://api.sendgrid.com)
58
+ * @param array $headers global request headers
59
+ * @param string $version api version (configurable) - this is specific to the SendGrid API
60
+ * @param array $path holds the segments of the url path
61
+ * @param array $curlOptions extra options to set during curl initialization
62
+ * @param bool $retryOnLimit set default retry on limit flag
61
63
*/
62
- public function __construct ($ host , $ headers = [] , $ version = ' /v3 ' , $ path = [] )
64
+ public function __construct ($ host , $ headers = null , $ version = null , $ path = null , $ curlOptions = null , $ retryOnLimit = false )
63
65
{
64
66
$ this ->host = $ host ;
65
- $ this ->headers = $ headers ;
67
+ $ this ->headers = $ headers ?: [] ;
66
68
$ this ->version = $ version ;
67
- $ this ->path = $ path ;
68
-
69
- $ this ->curlOptions = [];
70
- $ this ->retryOnLimit = false ;
69
+ $ this ->path = $ path ?: [];
70
+ $ this ->curlOptions = $ curlOptions ?: [];
71
+ $ this ->retryOnLimit = $ retryOnLimit ;
71
72
$ this ->isConcurrentRequest = false ;
72
73
$ this ->savedRequests = [];
73
74
}
0 commit comments