protected static function adapterFromDsn(string $dsn)
    {
        $vars = static::parseDsn($dsn);

        if (!class_exists($vars['className'])) {
            throw new \InvalidArgumentException('Unknown adapter');
        }

        return $vars['className']::client($vars);
    }
protected static function adapterFromDsn(string $dsn)
    {
        $vars = static::parseDsn($dsn);

        if (!class_exists($vars['className'])) {
            throw new \InvalidArgumentException('Unknown adapter');
        }

        return $vars['className']::client($vars);
    }
protected static function adapterFromDsn ( string $ dsn ) { $ vars = static :: parseDsn ( $ dsn ) ; if ( ! class_exists ( $ vars [ 'className' ] ) ) { throw new \ InvalidArgumentException ( 'Unknown adapter' ) ; } return $ vars [ 'className' ] :: client ( $ vars ) ; }
Parse dsn, map configuration and instantiate adapter.

@param string $dsn Data Source Name to parse and map.

@throws \InvalidArgumentException Thrown when the given adapter class doesn't exists.

@return AdapterInterface
Parse dsn map configuration and instantiate adapter .