private function resolveDatabaseType($type)
    {
        foreach ($this->getDatabases() as $database) {
            if ($database->type === $type) {
                return $database;
            }
        }
        throw new \DomainException(sprintf('Unknown database type (%s). Please use mysqli, pgsql or mariadb.', $type));
    }