public static function create($adapter, array $config = []): self
    {
        if (!isset(self::$adapterMap[$adapter])) {
            throw new DriverNotFoundException(sprintf(
                'Adapter "%s" not found. You should use one of: %s',
                $adapter,
                implode(', ', self::$adapterMap)
            ));
        }

        $class = self::$adapterMap[$adapter];

        return new self(new $class($config));
    }
public static function create($adapter, array $config = []): self
    {
        if (!isset(self::$adapterMap[$adapter])) {
            throw new DriverNotFoundException(sprintf(
                'Adapter "%s" not found. You should use one of: %s',
                $adapter,
                implode(', ', self::$adapterMap)
            ));
        }

        $class = self::$adapterMap[$adapter];

        return new self(new $class($config));
    }
public static function create ( $ adapter , array $ config = [ ] ) : self { if ( ! isset ( self :: $ adapterMap [ $ adapter ] ) ) { throw new DriverNotFoundException ( sprintf ( 'Adapter "%s" not found. You should use one of: %s' , $ adapter , implode ( ', ' , self :: $ adapterMap ) ) ) ; } $ class = self :: $ adapterMap [ $ adapter ] ; return new self ( new $ class ( $ config ) ) ; }
Creates a new Ldap instance.

@param string $adapter The adapter name
@param array  $config  The adapter's configuration

@return static
Creates a new Ldap instance .