Move fclose and unlink to before the return so they're actually called.

This commit is contained in:
Iain Cambridge 2014-05-13 14:57:23 +01:00
parent 502fac0b37
commit 33f3d27d7b

View File

@ -47,12 +47,12 @@ class Mailgun{
throw $ex; throw $ex;
} }
$result = $this->post("$workingDomain/messages.mime", $postData, array("message" => $tempFile)); $result = $this->post("$workingDomain/messages.mime", $postData, array("message" => $tempFile));
return $result;
fclose($fileName); fclose($fileName);
unlink($fileName); unlink($fileName);
return $result;
} }
else{ else{
throw new Exceptions\MissingRequiredMIMEParameters(EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS); throw new Exceptions\git (EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS);
} }
} }