From f08ea28622d80f4336b75945a53bb7f79b0e88b2 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Wed, 13 Nov 2024 17:16:55 +0100 Subject: [PATCH] Extend concordance list for entry types --- src/MDConcEntryTypes.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/MDConcEntryTypes.php b/src/MDConcEntryTypes.php index b4ed92b..2628ead 100644 --- a/src/MDConcEntryTypes.php +++ b/src/MDConcEntryTypes.php @@ -40,6 +40,8 @@ final class MDConcEntryTypes implements MDImporterConcordanceListInterface { "Seiffen" => "0", "aus" => "0", "Gerd" => "0", + "D-Einsiedel" => "0", + "D-Einsiedel," => "0", "Hersteller" => "0", // 1: Donation @@ -315,11 +317,16 @@ final class MDConcEntryTypes implements MDImporterConcordanceListInterface { */ public static function getConcordanceTarget(string $input):string { - if (!isset(self::ENTRY_TYPES_VERBOSE[$input])) { - throw new MDImporterMissingConcordance("Unknown entry type: " . $input); + if (isset(self::ENTRY_TYPES_VERBOSE[$input])) { + return self::ENTRY_TYPES_VERBOSE[$input]; } - return self::ENTRY_TYPES_VERBOSE[$input]; + $inputTrimmed = trim($input, " ,;.-_\t\n"); + if (isset(self::ENTRY_TYPES_VERBOSE[$inputTrimmed])) { + return self::ENTRY_TYPES_VERBOSE[$inputTrimmed]; + } + + throw new MDImporterMissingConcordance("Unknown entry type: " . $input); } }