Add blacklist for invalid damage types
This commit is contained in:
@ -18,6 +18,10 @@ final class MDConcDamageTypes implements MDImporterConcordanceListInterface {
|
||||
"Desiccation" => MDObjectDamageType::desiccation,
|
||||
];
|
||||
|
||||
private const DAMAGE_TYPES_BLACKLIST = [
|
||||
'keine',
|
||||
];
|
||||
|
||||
/**
|
||||
* Require a function for getting the concordance target.
|
||||
*
|
||||
@ -28,6 +32,11 @@ final class MDConcDamageTypes implements MDImporterConcordanceListInterface {
|
||||
public static function getConcordanceTarget(string $input):MDObjectDamageType {
|
||||
|
||||
if (!isset(self::DAMAGE_TYPES[$input])) {
|
||||
|
||||
if (in_array($input, self::DAMAGE_TYPES_BLACKLIST, true)) {
|
||||
throw new MDImporterBlacklistedConcordanceTerm("Invalid damage type: " . $input);
|
||||
}
|
||||
|
||||
throw new MDImporterMissingConcordance("Unknown damage type: " . $input);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user