Skip to content

Commit

Permalink
Use empty function to check if phone number handle is set
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnynotsolucky committed Oct 2, 2023
1 parent 4c4ae3c commit 1053323
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/services/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 !== '';
}
);

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1053323

Please sign in to comment.