From 10533237f226d500dc8569b195d8982fd9865728 Mon Sep 17 00:00:00 2001 From: Tyrone Tudehope Date: Mon, 2 Oct 2023 12:05:35 +0200 Subject: [PATCH] Use empty function to check if phone number handle is set --- src/services/Xml.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/Xml.php b/src/services/Xml.php index 21d4576..68141fe 100644 --- a/src/services/Xml.php +++ b/src/services/Xml.php @@ -351,9 +351,9 @@ private function generateName($firstName, $lastName): ?string $names = [$firstName, $lastName]; $names = array_filter( - $names, - function($name) { - return $name !== null && $name !== ''; + $names, + function($name) { + return $name !== null && $name !== ''; } ); @@ -453,8 +453,8 @@ public function address(\SimpleXMLElement $xml, Address $address=null, $name='Ad */ 'Country' => 'countryCode', ]; - - if($settings->phoneNumberFieldHandle != '' && $settings->phoneNumberFieldHandle != null){ + + if(!empty($settings->phoneNumberFieldHandle)){ $address_mapping['Phone'] = $settings->phoneNumberFieldHandle; }