Skip to content

Commit e9419a0

Browse files
authored
Setters should return current object.
1 parent 8c75ab0 commit e9419a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/SparkPost/SparkPost.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ public function getUrl($path, $params = [])
208208
* Sets $httpClient to be used for request.
209209
*
210210
* @param HttpClient|HttpAsyncClient $httpClient - the client to be used for request
211+
*
212+
* @return SparkPost
211213
*/
212214
public function setHttpClient($httpClient)
213215
{
@@ -216,12 +218,16 @@ public function setHttpClient($httpClient)
216218
}
217219

218220
$this->httpClient = $httpClient;
221+
222+
return $this;
219223
}
220224

221225
/**
222226
* Sets the options from the param and defaults for the SparkPost object.
223227
*
224228
* @param array $options - either an string API key or an array of options
229+
*
230+
* @return SparkPost
225231
*/
226232
public function setOptions($options)
227233
{
@@ -243,6 +249,8 @@ public function setOptions($options)
243249
$this->options[$option] = $value;
244250
}
245251
}
252+
253+
return $this;
246254
}
247255

248256
/**

0 commit comments

Comments
 (0)