Use function getConcordanceTarget() over direct array access
This commit is contained in:
@ -9,9 +9,9 @@ declare(strict_types = 1);
|
||||
/**
|
||||
* Provides lists for categorizing spelled out marking positions.
|
||||
*/
|
||||
final class MDConcMarkingPosition {
|
||||
final class MDConcMarkingPosition implements MDImporterConcordanceListInterface {
|
||||
|
||||
const MARKING_POSITIONS_VERBOSE = [
|
||||
private const MARKING_POSITIONS_VERBOSE = [
|
||||
|
||||
// Center
|
||||
"mittig" => "center",
|
||||
@ -294,4 +294,20 @@ final class MDConcMarkingPosition {
|
||||
"oberer Holzkasten" => "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::MARKING_POSITIONS_VERBOSE[$input])) {
|
||||
throw new MDImporterMissingConcordance("Unknown marking position: " . $input);
|
||||
}
|
||||
|
||||
return self::MARKING_POSITIONS_VERBOSE[$input];
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user