From fa9d53c6ff17cf183de0e7d55399e95aece57a01 Mon Sep 17 00:00:00 2001 From: Artem Bondarenko Date: Thu, 28 Jan 2021 17:10:14 +0200 Subject: [PATCH] removed unreachable throw --- src/Api/EmailValidationV4.php | 4 ++-- src/Api/Message.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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 [