@@ -77,22 +77,23 @@ class Client
77
77
private $ methods = ['get ' , 'post ' , 'patch ' , 'put ' , 'delete ' ];
78
78
79
79
/**
80
- * Initialize the client
81
- *
82
- * @param string $host the base url (e.g. https://api.sendgrid.com)
83
- * @param array $headers global request headers
84
- * @param string $version api version (configurable)
85
- * @param array $path holds the segments of the url path
86
- */
87
- public function __construct ($ host , array $ headers = [], $ version = '/v3 ' , array $ path = [])
80
+ * Initialize the client
81
+ *
82
+ * @param string $host the base url (e.g. https://api.sendgrid.com)
83
+ * @param array $headers global request headers
84
+ * @param string $version api version (configurable) - this is specific to the SendGrid API
85
+ * @param array $path holds the segments of the url path
86
+ * @param array $curlOptions extra options to set during curl initialization
87
+ * @param bool $retryOnLimit set default retry on limit flag
88
+ */
89
+ public function __construct ($ host , $ headers = null , $ version = null , $ path = null , $ curlOptions = null , $ retryOnLimit = false )
88
90
{
89
91
$ this ->host = $ host ;
90
- $ this ->headers = $ headers ;
92
+ $ this ->headers = $ headers ?: [] ;
91
93
$ this ->version = $ version ;
92
- $ this ->path = $ path ;
93
-
94
- $ this ->curlOptions = [];
95
- $ this ->retryOnLimit = false ;
94
+ $ this ->path = $ path ?: [];
95
+ $ this ->curlOptions = $ curlOptions ?: [];
96
+ $ this ->retryOnLimit = $ retryOnLimit ;
96
97
$ this ->isConcurrentRequest = false ;
97
98
$ this ->savedRequests = [];
98
99
}
0 commit comments