From 33f3d27d7b5e42b08d69154d5cc9eac098e8bcbc Mon Sep 17 00:00:00 2001 From: Iain Cambridge Date: Tue, 13 May 2014 14:57:23 +0100 Subject: [PATCH] Move fclose and unlink to before the return so they're actually called. --- src/Mailgun/Mailgun.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mailgun/Mailgun.php b/src/Mailgun/Mailgun.php index 9699a01..fa342d7 100644 --- a/src/Mailgun/Mailgun.php +++ b/src/Mailgun/Mailgun.php @@ -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); } }