src/DatabaseManager.php
public function driver(string $driver): DriverInterface
    {
        if (isset($this->drivers[$driver])) {
            return $this->drivers[$driver];
        }
        try {
            return $this->drivers[$driver] = $this->config->getDriver($driver)->resolve($this->factory);
        } catch (ContainerExceptionInterface $e) {
            throw new DBALException($e->getMessage(), $e->getCode(), $e);
        }
    }
public function driver(string $driver): DriverInterface
    {
        if (isset($this->drivers[$driver])) {
            return $this->drivers[$driver];
        }
        try {
            return $this->drivers[$driver] = $this->config->getDriver($driver)->resolve($this->factory);
        } catch (ContainerExceptionInterface $e) {
            throw new DBALException($e->getMessage(), $e->getCode(), $e);
        }
    }
public function driver ( string $ driver ) : DriverInterface { if ( isset ( $ this -> drivers [ $ driver ] ) ) { return $ this -> drivers [ $ driver ] ; } try { return $ this -> drivers [ $ driver ] = $ this -> config -> getDriver ( $ driver ) -> resolve ( $ this -> factory ) ; } catch ( ContainerExceptionInterface $ e ) { throw new DBALException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } }
Get driver instance by it's name or automatically create one.

@param string $driver
@return DriverInterface

@throws DBALException
Get driver instance by it s name or automatically create one .