public static function factory($config = array())
    {
        $defaults = array();

        $required = array(
            'base_url',
            'login',
            'password'
        );

        $config = Collection::fromConfig($config, $defaults, $required);

        $client = new self($config['base_url'], $config);

        return $client;
    }
public static function factory($config = array())
    {
        $defaults = array();

        $required = array(
            'base_url',
            'login',
            'password'
        );

        $config = Collection::fromConfig($config, $defaults, $required);

        $client = new self($config['base_url'], $config);

        return $client;
    }
public static function factory ( $ config = array ( ) ) { $ defaults = array ( ) ; $ required = array ( 'base_url' , 'login' , 'password' ) ; $ config = Collection :: fromConfig ( $ config , $ defaults , $ required ) ; $ client = new self ( $ config [ 'base_url' ] , $ config ) ; return $ client ; }
Basic factory method to create a new client. Extend this method in subclasses to build more complex clients.

@param array|Collection $config Configuration data

@return Client
Basic factory method to create a new client . Extend this method in subclasses to build more complex clients .