Skip to content

Commit 3716c6a

Browse files
authored
Merge pull request #149 from zaporylie/patch-2
Setters should return current object.
2 parents 0c45993 + e9419a0 commit 3716c6a

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
@@ -242,6 +242,8 @@ public function getUrl($path, $params = [])
242242
* Sets $httpClient to be used for request.
243243
*
244244
* @param HttpClient|HttpAsyncClient $httpClient - the client to be used for request
245+
*
246+
* @return SparkPost
245247
*/
246248
public function setHttpClient($httpClient)
247249
{
@@ -250,12 +252,16 @@ public function setHttpClient($httpClient)
250252
}
251253

252254
$this->httpClient = $httpClient;
255+
256+
return $this;
253257
}
254258

255259
/**
256260
* Sets the options from the param and defaults for the SparkPost object.
257261
*
258262
* @param array $options - either an string API key or an array of options
263+
*
264+
* @return SparkPost
259265
*/
260266
public function setOptions($options)
261267
{
@@ -277,6 +283,8 @@ public function setOptions($options)
277283
$this->options[$option] = $value;
278284
}
279285
}
286+
287+
return $this;
280288
}
281289

282290
/**

0 commit comments

Comments
 (0)