diff --git a/exceptions/MDImporterMissingConcordance.php b/exceptions/MDImporterMissingConcordance.php index ce24a94..b457d0d 100644 --- a/exceptions/MDImporterMissingConcordance.php +++ b/exceptions/MDImporterMissingConcordance.php @@ -5,6 +5,28 @@ declare(strict_types = 1); * Exception thrown in case an update failed. */ final class MDImporterMissingConcordance extends Exception { + + public string $target_type; + public string $value_to_map; + + /** + * Sets up an error. + * + * @param string $target_type Target type (e.g. "measurements"). + * @param string $value_to_map Value to map. + * + * @return MDImporterMissingConcordance + */ + public static function setup(string $target_type, string $value_to_map):MDImporterMissingConcordance { + + $exception = new MDImporterMissingConcordance("Unmapped specific value of type " . $target_type . ": " . $value_to_map); + $exception->target_type = $target_type; + $exception->value_to_map = $value_to_map; + + return $exception; + + } + /** * Error message. * diff --git a/src/MDConcActor.php b/src/MDConcActor.php index 0d75601..1636fb3 100644 --- a/src/MDConcActor.php +++ b/src/MDConcActor.php @@ -656,6 +656,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface { "Zeichnerin" => 19, "Zeichner*in" => 19, 'Zeichner/in' => 19, // drawn by + 'Zeichnung' => 19, // drawn by "Zeichner / Inventor" => 19, "Zeichner, Autor der Dekoration" => 19, "Zeichner und Grafiker" => 19, @@ -1277,7 +1278,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):int { if (!isset(self::ACTOR_ROLES_TO_EVENT_TYPE[$input])) { - throw new MDImporterMissingConcordance("Unknown actor role: " . $input); + throw MDImporterMissingConcordance::setup("actor role", $input); } return self::ACTOR_ROLES_TO_EVENT_TYPE[$input]; diff --git a/src/MDConcCertainty.php b/src/MDConcCertainty.php index 6f3f019..bde4848 100644 --- a/src/MDConcCertainty.php +++ b/src/MDConcCertainty.php @@ -56,7 +56,7 @@ final class MDConcCertainty implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):bool { if (!isset(self::MAPPING[$input])) { - throw new MDImporterMissingConcordance("Unknown certainty identifier: " . $input); + throw MDImporterMissingConcordance::setup("certainty identifier", $input); } return self::MAPPING[$input]; diff --git a/src/MDConcCheckTypes.php b/src/MDConcCheckTypes.php index 02489e1..17fd19c 100644 --- a/src/MDConcCheckTypes.php +++ b/src/MDConcCheckTypes.php @@ -25,7 +25,7 @@ final class MDConcCheckTypes implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):MDObjectCheckType { if (!isset(self::CHECK_TYPES[$input])) { - throw new MDImporterMissingConcordance("Unknown check type: " . $input); + throw MDImporterMissingConcordance::setup("check", $input); } return self::CHECK_TYPES[$input]; diff --git a/src/MDConcCloserLocationTypes.php b/src/MDConcCloserLocationTypes.php index d83aef1..7d2819f 100644 --- a/src/MDConcCloserLocationTypes.php +++ b/src/MDConcCloserLocationTypes.php @@ -45,7 +45,7 @@ final class MDConcCloserLocationTypes implements MDImporterConcordanceListInterf public static function getConcordanceTarget(string $input):string { if (!isset(self::LOCATION_TYPES_VERBOSE[$input])) { - throw new MDImporterMissingConcordance("Unknown location type: " . $input); + throw MDImporterMissingConcordance::setup("location", $input); } return self::LOCATION_TYPES_VERBOSE[$input]; diff --git a/src/MDConcColors.php b/src/MDConcColors.php index 9af5555..9f4c04a 100644 --- a/src/MDConcColors.php +++ b/src/MDConcColors.php @@ -26,7 +26,7 @@ final class MDConcColors implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):string { if (!isset(self::COLORS_LIST[$input])) { - throw new MDImporterMissingConcordance("Unknown color: " . $input); + throw MDImporterMissingConcordance::setup("color", $input); } return self::COLORS_LIST[$input]; diff --git a/src/MDConcCurrencies.php b/src/MDConcCurrencies.php index fa5c8cf..6abc7af 100644 --- a/src/MDConcCurrencies.php +++ b/src/MDConcCurrencies.php @@ -99,7 +99,7 @@ final class MDConcCurrencies implements MDImporterConcordanceListInterface { if (in_array($input, MDCurrenciesSet::CURRENCIES, true)) { return $input; } - throw new MDImporterMissingConcordance("Unknown currency: " . $input); + throw MDImporterMissingConcordance::setup("currency", $input); } return self::CURRENCIES_LIST[$input]; diff --git a/src/MDConcDamageTypes.php b/src/MDConcDamageTypes.php index e154a9c..96a035d 100644 --- a/src/MDConcDamageTypes.php +++ b/src/MDConcDamageTypes.php @@ -37,7 +37,7 @@ final class MDConcDamageTypes implements MDImporterConcordanceListInterface { throw new MDImporterBlacklistedConcordanceTerm("Invalid damage type: " . $input); } - throw new MDImporterMissingConcordance("Unknown damage type: " . $input); + throw MDImporterMissingConcordance::setup("damage", $input); } return self::DAMAGE_TYPES[$input]; diff --git a/src/MDConcEntryTypes.php b/src/MDConcEntryTypes.php index 784e5fb..df70c18 100644 --- a/src/MDConcEntryTypes.php +++ b/src/MDConcEntryTypes.php @@ -376,7 +376,7 @@ final class MDConcEntryTypes implements MDImporterConcordanceListInterface { return self::ENTRY_TYPES_VERBOSE[$inputTrimmed]; } - throw new MDImporterMissingConcordance("Unknown entry type: " . $input); + throw MDImporterMissingConcordance::setup("entry (to museum)", $input); } } diff --git a/src/MDConcEventTypes.php b/src/MDConcEventTypes.php index 16bd4cc..6ba0d3e 100644 --- a/src/MDConcEventTypes.php +++ b/src/MDConcEventTypes.php @@ -397,7 +397,7 @@ vermuteter Herstellungsort' => 1, public static function getConcordanceTarget(string $input):int { if (!isset(self::EVENT_TYPE_NAMES_TO_ID[$input])) { - throw new MDImporterMissingConcordance("Unknown event type: '" . $input . "'"); + throw MDImporterMissingConcordance::setup("event", $input); } return self::EVENT_TYPE_NAMES_TO_ID[$input]; diff --git a/src/MDConcLanguages.php b/src/MDConcLanguages.php index 88c6698..9f9c604 100644 --- a/src/MDConcLanguages.php +++ b/src/MDConcLanguages.php @@ -86,7 +86,7 @@ final class MDConcLanguages implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):string { if (!isset(self::LANGUAGES_LIST[$input])) { - throw new MDImporterMissingConcordance("Unknown language type: " . $input); + throw MDImporterMissingConcordance::setup("language", $input); } return self::LANGUAGES_LIST[$input]; diff --git a/src/MDConcLicenses.php b/src/MDConcLicenses.php index 7686a1a..bffe9b8 100644 --- a/src/MDConcLicenses.php +++ b/src/MDConcLicenses.php @@ -163,7 +163,7 @@ final class MDConcLicenses implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):string { if (!isset(self::LICENSES_LIST[$input])) { - throw new MDImporterMissingConcordance("Unknown licence type: " . $input); + throw MDImporterMissingConcordance::setup("licence", $input); } return self::LICENSES_LIST[$input]; diff --git a/src/MDConcLoanTypes.php b/src/MDConcLoanTypes.php index 734ac66..b9ff866 100644 --- a/src/MDConcLoanTypes.php +++ b/src/MDConcLoanTypes.php @@ -31,7 +31,7 @@ final class MDConcLoanTypes implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):string { if (!isset(self::LOAN_TYPES[$input])) { - throw new MDImporterMissingConcordance("Unknown loan type: " . $input); + throw MDImporterMissingConcordance::setup("loan", $input); } return self::LOAN_TYPES[$input]; diff --git a/src/MDConcMarkingPosition.php b/src/MDConcMarkingPosition.php index 09f591c..675c78e 100644 --- a/src/MDConcMarkingPosition.php +++ b/src/MDConcMarkingPosition.php @@ -450,7 +450,7 @@ final class MDConcMarkingPosition implements MDImporterConcordanceListInterface public static function getConcordanceTarget(string $input):string { if (!isset(self::MARKING_POSITIONS_VERBOSE[$input])) { - throw new MDImporterMissingConcordance("Unknown marking position: " . $input); + throw MDImporterMissingConcordance::setup("marking position", $input); } return self::MARKING_POSITIONS_VERBOSE[$input]; diff --git a/src/MDConcMarkingType.php b/src/MDConcMarkingType.php index d2cd7fd..a5bbcc5 100644 --- a/src/MDConcMarkingType.php +++ b/src/MDConcMarkingType.php @@ -453,7 +453,7 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):string { if (!isset(self::MARKING_TYPES_VERBOSE[$input])) { - throw new MDImporterMissingConcordance("Unknown marking type: " . $input); + throw MDImporterMissingConcordance::setup("marking", $input); } return self::MARKING_TYPES_VERBOSE[$input]; diff --git a/src/MDConcMeasurementTypes.php b/src/MDConcMeasurementTypes.php index 8a0d685..5604734 100644 --- a/src/MDConcMeasurementTypes.php +++ b/src/MDConcMeasurementTypes.php @@ -187,8 +187,56 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface "Höhe (Objekt)", "Höhe (Etui)", "Höhe (Heft)", + "Höhe (Foto)", "Höhe (Dose)", "Höhe (netto)", + "Höhe (a mit b-d)", + "Höhe (e)", + "Höhe (S 6289/5a)", + "Höhe (S 6289/5b)", + "Höhe (S 6291/3)", + "Höhe (S 6291/4)", + "Höhe (S 6291/5)", + "Höhe (S 6291/6)", + "Höhe (S 6295/3)", + "Höhe (S 6295/4)", + "Höhe (S 6295/5)", + "Höhe (S 6316/1)", + "Höhe (S 6316/2)", + "Höhe (S 6316/3)", + "Höhe (S 6316/4)", + "Höhe (S 6316/5)", + "Höhe (S 6418a)", + "Höhe (aufgeklappt)", + "Höhe (S 6419a)", + "Höhe (a)", + "Höhe (a mit b)", + "Höhe (S 6519/1)", + "Höhe (S 6530/1)", + "Höhe (S 6542/1)", + "Höhe (S 6549/1-3)", + "Höhe (S 6552/1-5)", + "Höhe (je Band)", + "Höhe (ohne Schnur)", + "Höhe (S 6560/1a-c =)", + "Höhe (S 6561/10 = größter)", + "Höhe (S 6561/13, andere)", + "Höhe (S 6561/18,)", + "Höhe (Nadel auf Papier)", + "Höhe (Hose in Ver-)", + "Höhe (einzelnes Tütchen)", + "Höhe (1)", + "Höhe (a-c)", + "Höhe (Kanne)", + "Höhe (S 6832/1)", + "Höhe (a und b)", + "Höhe (je Bild)", + "Höhe (S 6844/1)", + "Höhe (S 6844/2)", + "Höhe (je Liste)", + "Höhe (je Plan außer 3b)", + "Höhe (Platte in Hülle)", + "Höhe (S 6852/1)", "Höhe (Druckstock)", "Höhe (Blatt/Platte)", "Höhe (ausgeklappt)", @@ -245,16 +293,139 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface 'Höhe (Einleger 22)', 'Höhe (Einleger 23)', 'Höhe (Einleger 24)', + "Höhe (S 6530/2)", + "Höhe (S 6542/2)", + "Höhe (S 6549/4-5)", + "Höhe (S 6552/6)", + "Höhe (S 6832/2)", + "Höhe (S 6845/3b)", + "Höhe (S 6852/2a-b)", + "Höhe (S 6877/3)", + "Höhe (S 6914/2)", + "Höhe (S 6931/2)", + "Höhe (S 6941/2)", + "Höhe (S 6962/7)", + "Höhe (S 7083/2)", + "Höhe (S 7135/1b)", + "Höhe (5)", + "Höhe (S 6561/11)", + "Höhe (S 6542/5)", + "Höhe (S 7135/3)", + "Höhe (S 7141/2)", + "Höhe (Springerle in Tüte)", + "Höhe (b)", + "Höhe (e und f)", + "Höhe (eine Glühbirne)", + "Höhe (gesamter Stapel)", + "Höhe (gesamter Stapel)[67/4521]", + "Höhe (S 6877/1 u. 2)", + "Höhe (je Album)", + "Höhe (1)", + "Höhe (Griff, beide Hälften)", + "Höhe (1)", + "Höhe (S 6914/1)", + "Höhe (gesamter Bogen)", + "Höhe (Springerle)", + "Höhe (S 6931/1)", + "Höhe (S 6941/1)", + "Höhe (S 6962/1-6, je)", + "Höhe (a mit b)", + "Höhe (je Ziegel)", + "Höhe (S 6519/7)", + "Höhe (S 6519/8)", + "Höhe (S 6519/9)", + "Höhe (1-4)", + "Höhe (je)", + "Höhe (Tafel)", + "Höhe (Plakette)", + "Höhe (a)", + "Höhe (Insgesamt)", + "Höhe (S 7083/1)", + "Höhe (Stich ohne Rahmen)", + "Höhe (pro Plombe)", + "Höhe (3)", + "Höhe (3-4)", + "Höhe (Haube)", + "Höhe (S 6519/4)", + "Höhe (S 6542/4)", + "Höhe (S 7135/2)", + "Höhe (d)", + "Höhe (a-b)", + "Höhe (1)", + "Höhe (1)", + "Höhe (je Tuch)", + "Höhe (a)", + "Höhe (1 und 2, je a-b)", + "Höhe (S 7135/1a)", + "Höhe (S 7141/1)", + "Höhe (je Vierer-Bogen)", + "Höhe (a und b)", + "Höhe (a)", + "Höhe (b und d)", + "Höhe (S 7408/2)", + "Höhe (je Teller)", + "Höhe (a)", + "Höhe (a und c)", + "Höhe (Eimerchen)", + "Höhe (S 7408/1)", + "Höhe (a mit b)", + "Höhe (m. Rahmeninkl.Aufhä.)", + "Höhe (a)", + "Höhe (a mit b)", 'Höhe (Passepartout)', 'Höhe (Unterlage)', 'Höhe (Buch)', 'Höhe (Jeder Druck)', 'Höhe (Gesamthöhe)', + "Höhe (1 Tassengedeck)", + "Höhe (1 und 2, je c-e)", + "Höhe (2)", + "Höhe (5-6)", + "Höhe (Nadeln in Verpack.)", + "Höhe (S 6418b)", + "Höhe (S 6419b)", + "Höhe (S 6542/3)", + "Höhe (S 6877/4)", + "Höhe (S 6914/3)", + "Höhe (S 6962/8)", + "Höhe (S 7083/3)", + "Höhe (S 7135/1c)", + "Höhe (c)", + "Höhe (g mit h)", "Reliefhöhe" => MDMeasurementType::height, "Länge", "Länge OT", "Länge H", + "Länge (1)", + "Länge (2)", + "Länge (3)", + "Länge (4)", + "Länge (5)", + "Länge (6)", + "Länge (7)", + "Länge (8)", + "Länge (a)", + "Länge (b)", + "Länge (c)", + "Länge (d)", + "Länge (e)", + "Länge (f)", + "Länge (g)", + "Länge (8)", + "Länge (1c)", + "Länge (S 6514/3)", + "Länge (S 6519/3)", + "Länge (S 7139/3)", + "Tiefe (S 6553/2)", + "Länge (S 6398/21)", + "Länge (S 6398/22)", + "Länge (1f)", + "Länge (S 6519/6)", + "Länge (S 7139/6)", + "Länge (S 7139/7)", + "Länge (S 7139/8)", + "Länge (S 7139/9)", "Länge (ausgeklappt)", "length", "(Länge)", @@ -276,6 +447,16 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface "Außenmaß (Tiefe)", "Teife", "length", + "Länge (1b)", + "Länge (S 6424/4)", + "Länge (S 6514/2)", + "Länge (S 6519/2)", + "Länge (S 6795/2a und b)", + "Länge (S 7069b)", + "Länge (S 7081/3)", + "Länge (S 7139/2)", + "Tiefe (S 6553/1)", + "Tiefe (per Päckchen)", "Bruttomass (Länge)", "Bruttomass (Tiefe)", "Kartierung (Länge)", @@ -326,6 +507,25 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface 'Tiefe (Buch)', 'Länge (Dose)', 'Tiefe (Dose)', + "Länge (1a)", + "Länge (S 7081/1-2)", + "Länge (S 7139/1)", + "Länge (S 6519/8a-e)", + "Länge (S 6514/1)", + "Länge (S 6424/3)", + "Länge (mit Kordel)", + "Länge (S 6795/1a und b)", + "Länge (1d)", + "Länge (S 6419c)", + "Länge (S 7139/4)", + "Länge (mit Handhabe)", + "Länge (1e)", + "Länge (S 6519/5)", + "Länge (S 6560/1b = Samtband)", + "Länge (S 7139/5)", + "Tiefe (kleinerer Größe)", + "Tiefe (etwas kleiner)", + "Tiefe (ähnlicher Größe)", "depth", "Dicke" => MDMeasurementType::length, @@ -337,8 +537,11 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface "Breite (Etui)", "Breite (Heft)", "Breite (netto)", - "Breite (Batt)", + "Breite (Foto)", + "Breite (a)", + "Breite (S 7069a)", "Breite (aufgeschlagen)", + "Breite (S 6799/1)", "Breite größtes Stück", "Breite (gesamt)", "Breite (Druckstock)", @@ -351,7 +554,24 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface "(Breite)", "Lichtmass (Breite)", " (Breite)", + "Breite (ein Nagel)", "width", + "Breite (S 6576/1)", + "Breite (mit Griffen)", + "Breite (mit Handhabe)", + "Breite (BH, S 6561/1 - 9 mit)", + "Breite (Ensemble im Kästchen)", + "Breite (Hüfthalter)", + "Breite (S 6561/19-20 mit)", + "Breite (S 6576/2a-b)", + "Breite (S 6799/2a-b)", + "Breite (S 7069a und b)", + "Breite (a-d)", + "Breite (b)", + "Breite (c)", + "Breite (gesamt mit Handhabe)", + "Breite (mit Henkel)", + "Breite (packung)", "width (overall)", "Breite (Griff)", "Außenmaß (Breite)", @@ -373,6 +593,8 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface 'Breite (Buchblock mit Einabnd)', 'Breite (Stein)', 'Breite (Schuber)', + "Breite (S 6560/1a = Anhänger)", + "Breite (vergleichbarer od.)", 'Breite (Karton)', 'Breite (Einleger)', 'Breite (Einleger 1)', @@ -414,6 +636,62 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface "Mündung (Durchmesser)", "Rahmenaußenmaß Durchmesser", "diameter", + "Durchmesser (a)", + "Durchmesser (b)", + "Durchmesser (c)", + "Durchmesser (d)", + "Durchmesser (e)", + "Durchmesser (f)", + "Durchmesser (g)", + "Durchmesser (1)", + "Durchmesser (2)", + "Durchmesser (3)", + "Durchmesser (4)", + "Durchmesser (S 7133/1)", + "Durchmesser (S 7133/3)", + "Durchmesser (S 7133/4)", + "Durchmesser (S 7134/1)", + "Durchmesser (S 7139/10)", + "Durchmesser (S 7139/11)", + "Durchmesser (S 6406/9a)", + "Durchmesser (S 6406/10a)", + "Durchmesser (S 6406/11a)", + "Durchmesser (S 6406/12a)", + "Durchmesser (S 6406/13a)", + "Durchmesser (S 6406/14a)", + "Durchmesser (S 6406/15a)", + "Durchmesser (S 6406/16a)", + "Durchmesser (S 6406/17a)", + "Durchmesser (S 6406/10c)", + "Durchmesser (S 6406/11c)", + "Durchmesser (S 6406/12c)", + "Durchmesser (S 6406/13c)", + "Durchmesser (S 6406/14c)", + "Durchmesser (S 6406/15b)", + "Durchmesser (S 6406/16b)", + "Durchmesser (S 6406/17b)", + "Durchmesser (S 6406/9c)", + "Durchmesser (S 6406/9d)", + "Durchmesser (S 6406/9e)", + "Durchmesser (S 6406/9f)", + "Durchmesser (S 6406/9g)", + "Durchmesser (Haube)", + "Durchmesser (S 6406/10d)", + "Durchmesser (S 6406/11d)", + "Durchmesser (Stand)", + "Durchmesser (Fuß)", + "Durchmesser (Rand /2)", + "Durchmesser (S 6406/10b)", + "Durchmesser (S 6406/11b)", + "Durchmesser (S 6406/12b)", + "Durchmesser (S 6406/13b)", + "Durchmesser (S 6406/14b)", + "Durchmesser (S 6406/9b)", + "Durchmesser (S 7133/2)", + "Durchmesser (S 7133/5)", + "Durchmesser (oberer Rand)", + "Durchmesser (Rand /1)", + "Durchmesser (Foto)", "Außenmaß (Durchmesser)", "Durchmesser in Richtung Bohrung", "Durchmesser quer zur Bohrung", @@ -424,7 +702,6 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface "Durchmesser (Höhe)", "Durchmesser (Breite)", "Durchmesser (Länge)", - "Durchmesser (Länge)", "Durchmesser (Dose)", "Objektmaß (Durchmesser)", "Objektmass (Durchmesser)", @@ -456,6 +733,7 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface "Breite (Blatt)", "Blattmaß (Breite)", + "Breite (Batt)", "Breite (Blatt/Platte)", "Breite (Blattplatte)", "Breite (Blatt (mittig gefalzt))", @@ -472,6 +750,13 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface "Höhe (Darsetllung)", "Höhe (Blatt/Darstellung)", "Bildmaß (Höhe)", + "Höhe (Grafik ohne Pass.)", + "Höhe (Grafik ohne Pass.)", + "Höhe (Grafik ohne Pass.)", + "Höhe (Grafik ohne Pass.)", + "Höhe (Grafik ohne Pass.)", + "Höhe (Grafik ohne Passep.)", + "Höhe (Grafik ohne Passep.)", "Höhe (Platte/Bild)", "Höhe (Druckstock/Bild)", "Höhe max (Darstellung)", @@ -608,7 +893,7 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface "Bodendurchmesser", "Durchmesser (Boden)" => MDMeasurementType::diameter_of_base, - default => throw new MDImporterMissingConcordance("Unmapped specific measurement type: " . $input), + default => throw MDImporterMissingConcordance::setup("measurements", $input), }; diff --git a/src/MDConcObjectForms.php b/src/MDConcObjectForms.php index 53181d5..aa34b91 100644 --- a/src/MDConcObjectForms.php +++ b/src/MDConcObjectForms.php @@ -26,7 +26,7 @@ final class MDConcObjectForms implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):string { if (!isset(self::FORMS_LIST[$input])) { - throw new MDImporterMissingConcordance("Unknown form type: " . $input); + throw MDImporterMissingConcordance::setup("form/shape", $input); } return self::FORMS_LIST[$input]; diff --git a/src/MDConcObjectTagRelTypes.php b/src/MDConcObjectTagRelTypes.php index 2cfc7e7..dad7d1e 100644 --- a/src/MDConcObjectTagRelTypes.php +++ b/src/MDConcObjectTagRelTypes.php @@ -80,7 +80,7 @@ final class MDConcObjectTagRelTypes implements MDImporterConcordanceListInterfac return self::RELATION_TYPES_MAPPED_TO_EVENTS[strtolower($input)]; } - throw new MDImporterMissingConcordance("Unknown object-tag relationship type: " . $input); + throw MDImporterMissingConcordance::setup("object-tag relationship", $input); } @@ -104,7 +104,7 @@ final class MDConcObjectTagRelTypes implements MDImporterConcordanceListInterfac throw new MDImporterTagRelationTypeIsEventType("Tag-object relationship type is signifies not tags, but an event component."); } - throw new MDImporterMissingConcordance("Unknown object-tag relationship type: '" . $input . "'"); + throw MDImporterMissingConcordance::setup("object-tag relationship", $input); } } diff --git a/src/MDConcOwnershipStatus.php b/src/MDConcOwnershipStatus.php index ba2a0c5..5b83405 100644 --- a/src/MDConcOwnershipStatus.php +++ b/src/MDConcOwnershipStatus.php @@ -65,7 +65,7 @@ final class MDConcOwnershipStatus implements MDImporterConcordanceListInterface if (isset(self::OWNERSHIP_TYPES_VERBOSE[trim($input)])) { return self::OWNERSHIP_TYPES_VERBOSE[trim($input)]; } - throw new MDImporterMissingConcordance("Unknown ownership type: " . $input); + throw MDImporterMissingConcordance::setup("ownership", $input); } return self::OWNERSHIP_TYPES_VERBOSE[$input]; diff --git a/src/MDConcPlace.php b/src/MDConcPlace.php index 48730cd..1c8eb07 100644 --- a/src/MDConcPlace.php +++ b/src/MDConcPlace.php @@ -108,7 +108,7 @@ final class MDConcPlace implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):int { if (!isset(self::PLACE_ROLES_TO_EVENT_TYPE[$input])) { - throw new MDImporterMissingConcordance("Unknown place type: " . $input); + throw MDImporterMissingConcordance::setup("place (in event)", $input); } return self::PLACE_ROLES_TO_EVENT_TYPE[$input]; diff --git a/src/MDConcSex.php b/src/MDConcSex.php index 363f976..1d4cfd4 100644 --- a/src/MDConcSex.php +++ b/src/MDConcSex.php @@ -13,6 +13,7 @@ final class MDConcSex implements MDImporterConcordanceListInterface { private const SEXES_LIST = [ 'Männlich' => 'male', + 'Weiblich' => 'female', 'diverse' => 'other', ]; @@ -26,7 +27,7 @@ final class MDConcSex implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):string { if (!isset(self::SEXES_LIST[$input])) { - throw new MDImporterMissingConcordance("Unknown sex type: " . $input); + throw MDImporterMissingConcordance::setup("sex", $input); } return self::SEXES_LIST[$input]; diff --git a/src/MDConcSourceTypes.php b/src/MDConcSourceTypes.php index 1186521..606af3f 100644 --- a/src/MDConcSourceTypes.php +++ b/src/MDConcSourceTypes.php @@ -68,7 +68,7 @@ final class MDConcSourceTypes implements MDImporterConcordanceListInterface { return self::SOURCE_TYPES[strtolower($input)]; } - throw new MDImporterMissingConcordance("Unknown source type: " . $input); + throw MDImporterMissingConcordance::setup("source", $input); } } diff --git a/src/MDConcTime.php b/src/MDConcTime.php index 8b7a89e..f201598 100644 --- a/src/MDConcTime.php +++ b/src/MDConcTime.php @@ -54,7 +54,7 @@ final class MDConcTime implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):int { if (!isset(self::TIME_ROLES_TO_EVENT_TYPE[$input])) { - throw new MDImporterMissingConcordance("Unknown time type: " . $input); + throw MDImporterMissingConcordance::setup("time (in event)", $input); } return self::TIME_ROLES_TO_EVENT_TYPE[$input]; diff --git a/src/MDConcTitleTypes.php b/src/MDConcTitleTypes.php index 8cfcb7b..a606945 100644 --- a/src/MDConcTitleTypes.php +++ b/src/MDConcTitleTypes.php @@ -45,7 +45,7 @@ final class MDConcTitleTypes implements MDImporterConcordanceListInterface { public static function getConcordanceTarget(string $input):string { if (!isset(self::TITLE_TYPES[$input])) { - throw new MDImporterMissingConcordance("Unknown title type: " . $input); + throw MDImporterMissingConcordance::setup("title", $input); } return self::TITLE_TYPES[$input];