Skip to content

Commit

Permalink
Merge pull request #68 from Jhut89/3.1.3
Browse files Browse the repository at this point in the history
add switch for closing connections
  • Loading branch information
Jhut89 authored Aug 16, 2019
2 parents 3dd46e4 + 77bdd5d commit 0ca9cb7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Requests/MailchimpConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,13 @@ private function setHandlerOptionsForMethod()

/**
* Executes a connection with the current request and settings
*
* @param bool $close close this connection after execution
*
* @return MailchimpResponse
* @throws MailchimpException
*/
public function execute()
public function execute($close = true)
{
$this->response = $this->executeCurl();
if (!$this->response) {
Expand All @@ -197,6 +200,10 @@ public function execute()
strlen($this->response)
);

if ($close) {
$this->close();
}

if ($this->isSuccess()) {
return new SuccessResponse(
$this->headers,
Expand Down

0 comments on commit 0ca9cb7

Please sign in to comment.