Skip to content

Commit

Permalink
Remove unreachable code
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed May 24, 2022
1 parent ca13ec4 commit 74dd5ab
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions CRM/Contact/Import/Parser/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,42 +214,8 @@ private function validateCustomField($customFieldID, $value, array $fieldMetaDat
return $fieldMetaData['label'];
}
}
elseif ($isSerialized && $dataType === 'StateProvince') {
$mulValues = explode(',', $value);
foreach ($mulValues as $stateValue) {
if ($stateValue) {
if (self::in_value(trim($stateValue), CRM_Core_PseudoConstant::stateProvinceAbbreviation()) || self::in_value(trim($stateValue), CRM_Core_PseudoConstant::stateProvince())) {
continue;
}
else {
return $fieldMetaData['label'];
}
}
}
}
elseif ($isSerialized && $dataType == 'Country') {
$mulValues = explode(',', $value);
foreach ($mulValues as $countryValue) {
if ($countryValue) {
CRM_Core_PseudoConstant::populate($countryNames, 'CRM_Core_DAO_Country', TRUE, 'name', 'is_active');
CRM_Core_PseudoConstant::populate($countryIsoCodes, 'CRM_Core_DAO_Country', TRUE, 'iso_code');
$limitCodes = CRM_Core_BAO_Country::countryLimit();

$error = TRUE;
foreach ([$countryNames, $countryIsoCodes, $limitCodes] as $values) {
if (in_array(trim($countryValue), $values)) {
$error = FALSE;
break;
}
}

if ($error) {
return $fieldMetaData['label'];
}
}
}
}
}

return NULL;
}

Expand Down

0 comments on commit 74dd5ab

Please sign in to comment.