code: protected function buildConnection(array $connectionConfig)
      {
          if (false === isset($connectionConfig['type'])) {
              throw new \InvalidArgumentException("Connection is not well formed : missing key \"type\"");
          }
  
          return $this->getConnectionFactory($connectionConfig['type'])->getConnection($connectionConfig);
      }
docs: Build connection
  @param array $connectionConfig
  @throws \InvalidArgumentException
  @return mixed