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];
    }
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];
    }
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 ] ; }
This filter takes the given string and translates it using the given value map.

@param string $value    The string value to translate
@param array  $valueMap Array of key value pairs where a key will match the given $value.

@return string
This filter takes the given string and translates it using the given value map .