diff --git a/src/Api/EmailValidationV4.php b/src/Api/EmailValidationV4.php index 917ff1e..3e4b818 100755 --- a/src/Api/EmailValidationV4.php +++ b/src/Api/EmailValidationV4.php @@ -240,6 +240,8 @@ class EmailValidationV4 extends HttpApi { $filename = isset($filePath['filename']) ? $filePath['filename'] : null; + $resource = null; + if (isset($filePath['fileContent'])) { // File from memory $resource = fopen('php://temp', 'r+'); @@ -255,8 +257,6 @@ class EmailValidationV4 extends HttpApi } $resource = fopen($path, 'r'); - } else { - throw new InvalidArgumentException('When using a file you need to specify parameter "fileContent" or "filePath"'); } return [ diff --git a/src/Api/Message.php b/src/Api/Message.php index 333c767..f804a49 100644 --- a/src/Api/Message.php +++ b/src/Api/Message.php @@ -144,6 +144,8 @@ class Message extends HttpApi } $resource = fopen($path, 'r'); + } else { + throw new InvalidArgumentException('When using a file you need to specify parameter "fileContent" or "filePath"'); } return [