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;
}
$result = $this->post("$workingDomain/messages.mime", $postData, array("message" => $tempFile));
fclose($fileName);
unlink($fileName);
return $result;
fclose($fileName);
unlink($fileName);
}
else{
throw new Exceptions\MissingRequiredMIMEParameters(EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS);
throw new Exceptions\git (EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS);
}
}