public static function translate(string $value, array $valueMap) : string
    {
        if (!array_key_exists($value, $valueMap)) {
            throw new FilterException("The value '{$value}' was not found in the translation map array.");
        }

        return $valueMap[$value];
    }