From 6fff162c0e68f3a23d56b96fef531caa97bc04f0 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 12 Apr 2022 09:59:35 +0000 Subject: [PATCH] Improve error message and return value. #658 --- src/Service/RisingTideGateway.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Service/RisingTideGateway.php b/src/Service/RisingTideGateway.php index 2a01799c..0a4ba1aa 100644 --- a/src/Service/RisingTideGateway.php +++ b/src/Service/RisingTideGateway.php @@ -36,7 +36,9 @@ class RisingTideGateway // at this point, assume that mobile is numeric and valid mobile number $clean_num = $this->cleanPhoneNumber($mobile_num); - if ($clean_num != '') + if ($clean_num == false) + error_log('Invalid mobile number provided. Cannot send SMS message to ' . $mobile_num); + else { $headers = [ 'Content-Type: application/vnd.net.wyrls.Document-v3+json' @@ -89,8 +91,6 @@ class RisingTideGateway error_log($result); } - else - error_log('Invalid mobile number provided. Cannot send SMS message.'); } public function validatePhoneNumber($mobile) @@ -151,6 +151,6 @@ class RisingTideGateway return $clean_number; } - return ""; + return false; } }