diff --git a/src/MDConcColors.php b/src/MDConcColors.php new file mode 100644 index 0000000..9af5555 --- /dev/null +++ b/src/MDConcColors.php @@ -0,0 +1,35 @@ + + */ +declare(strict_types = 1); + +/** + * Constains lists for grouping colors. + */ +final class MDConcColors implements MDImporterConcordanceListInterface { + + private const COLORS_LIST = [ + 'Gelb' => 'yellow', + 'Schwarz' => 'black', + ]; + + /** + * Require a function for getting the concordance target. + * + * @param string $input Input string. + * + * @return string + */ + public static function getConcordanceTarget(string $input):string { + + if (!isset(self::COLORS_LIST[$input])) { + throw new MDImporterMissingConcordance("Unknown color: " . $input); + } + + return self::COLORS_LIST[$input]; + + } +} diff --git a/src/MDConcObjectForms.php b/src/MDConcObjectForms.php new file mode 100644 index 0000000..53181d5 --- /dev/null +++ b/src/MDConcObjectForms.php @@ -0,0 +1,35 @@ + + */ +declare(strict_types = 1); + +/** + * Constains lists for grouping object forms / shapes. + */ +final class MDConcObjectForms implements MDImporterConcordanceListInterface { + + private const FORMS_LIST = [ + 'Würfel' => 'cube', + 'Zylinder' => 'cylinder', + ]; + + /** + * Require a function for getting the concordance target. + * + * @param string $input Input string. + * + * @return string + */ + public static function getConcordanceTarget(string $input):string { + + if (!isset(self::FORMS_LIST[$input])) { + throw new MDImporterMissingConcordance("Unknown form type: " . $input); + } + + return self::FORMS_LIST[$input]; + + } +} diff --git a/src/MDConcSex.php b/src/MDConcSex.php new file mode 100644 index 0000000..363f976 --- /dev/null +++ b/src/MDConcSex.php @@ -0,0 +1,35 @@ + + */ +declare(strict_types = 1); + +/** + * Constains lists for grouping sexes. + */ +final class MDConcSex implements MDImporterConcordanceListInterface { + + private const SEXES_LIST = [ + 'Männlich' => 'male', + 'diverse' => 'other', + ]; + + /** + * Require a function for getting the concordance target. + * + * @param string $input Input string. + * + * @return string + */ + public static function getConcordanceTarget(string $input):string { + + if (!isset(self::SEXES_LIST[$input])) { + throw new MDImporterMissingConcordance("Unknown sex type: " . $input); + } + + return self::SEXES_LIST[$input]; + + } +}