Use function getConcordanceTarget() over direct array access
This commit is contained in:
@ -9,9 +9,9 @@ declare(strict_types = 1);
|
||||
/**
|
||||
* Provides a list for finding the respective event type for a given time role.
|
||||
*/
|
||||
final class MDConcTime {
|
||||
final class MDConcTime implements MDImporterConcordanceListInterface {
|
||||
|
||||
const TIME_ROLES_TO_EVENT_TYPE = [
|
||||
private const TIME_ROLES_TO_EVENT_TYPE = [
|
||||
|
||||
# General / not yet (?) categorized
|
||||
"Laufzeit" => 24,
|
||||
@ -40,4 +40,20 @@ final class MDConcTime {
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Require a function for getting the concordance target.
|
||||
*
|
||||
* @param string $input Input string.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function getConcordanceTarget(string $input):int {
|
||||
|
||||
if (!isset(self::TIME_ROLES_TO_EVENT_TYPE[$input])) {
|
||||
throw new MDImporterMissingConcordance("Unknown time type: " . $input);
|
||||
}
|
||||
|
||||
return self::TIME_ROLES_TO_EVENT_TYPE[$input];
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user