Files
MDImporterConcordanceLists/src/MDConcPrecision.php
T

63 lines
1.5 KiB
PHP

<?PHP
declare(strict_types = 1);
/**
* Provides the mapping for precision values.
*/
final class MDConcPrecision implements MDImporterConcordanceListInterface {
/**
* Throws the appropriate error in case of unmatched precision values.
*
* @param string $input Input string.
*
* @return boolean
*/
private static function markMissingPrecision(string $input):bool {
MDImporterMissingConcordance::throw("precision", $input);
return false; // Return default in dry-run mode
}
/**
* Require a function for getting the concordance target.
*
* @param string $input Input string.
*
* @return boolean
*/
public static function getConcordanceTarget(string $input):bool {
return match($input) {
'verso bedruckt',
'mm',
'cm',
'Höhe',
'^',
'max.',
'min.',
'Breite',
'maximal',
'Türblatt',
'mit Verschluss',
'mit Aufhängung',
'max, mit Türklinke',
'17,6',
'11,5',
'Maße ohne Rahmen',
"Kassette",
"Schöpfkelle",
"Vorlegelöffel",
"aufgeklappt",
'mit Brett',
'' => true,
'schwer messbar, Schätzung',
'ca',
'ca.' => false,
default => self::markMissingPrecision($input),
};
}
}