@@ -77,22 +77,23 @@ class Client
7777 private $ methods = ['get ' , 'post ' , 'patch ' , 'put ' , 'delete ' ];
7878
7979 /**
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 )
8890 {
8991 $ this ->host = $ host ;
90- $ this ->headers = $ headers ;
92+ $ this ->headers = $ headers ?: [] ;
9193 $ 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 ;
9697 $ this ->isConcurrentRequest = false ;
9798 $ this ->savedRequests = [];
9899 }
0 commit comments