Doctrine DBAL

[GH-416] Small cleanups, simplification and removed no longer needed cast