Maybe it's better to remove those checks and build the DSN according to the given parameters. So if for example no host ist given, that parameter won't be appended to the DSN. The advantage would be that the underyling driver could throw an exception with a corresponding error code which in turn can be evaluated in `convertExceptionCode()` to the right DBAL exception code. Also if the host parameter is not given, the driver could fallback to localhost instead of throwing an exception.