@@ -54,20 +54,21 @@ class Client
5454 /**
5555 * Initialize the client
5656 *
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
6163 */
62- public function __construct ($ host , $ headers = [] , $ version = ' /v3 ' , $ path = [] )
64+ public function __construct ($ host , $ headers = null , $ version = null , $ path = null , $ curlOptions = null , $ retryOnLimit = false )
6365 {
6466 $ this ->host = $ host ;
65- $ this ->headers = $ headers ;
67+ $ this ->headers = $ headers ?: [] ;
6668 $ 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 ;
7172 $ this ->isConcurrentRequest = false ;
7273 $ this ->savedRequests = [];
7374 }
0 commit comments