public static function factory($config = array())
    {
        $required = array('base_url');
        $config = Collection::fromConfig($config, array(), $required);

        $client = new self($config->get('base_url'));

        $cookiePlugin = new CookiePlugin(new ArrayCookieJar());
        $client->addSubscriber($cookiePlugin);

        $client->setConfig($config);
        $client->setUserAgent('addwiki-guzzle-mediawiki-client');
        $client->setDescription(ServiceDescription::factory( dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'mediawiki.json'));

        return $client;
    }
public static function factory($config = array())
    {
        $required = array('base_url');
        $config = Collection::fromConfig($config, array(), $required);

        $client = new self($config->get('base_url'));

        $cookiePlugin = new CookiePlugin(new ArrayCookieJar());
        $client->addSubscriber($cookiePlugin);

        $client->setConfig($config);
        $client->setUserAgent('addwiki-guzzle-mediawiki-client');
        $client->setDescription(ServiceDescription::factory( dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'mediawiki.json'));

        return $client;
    }
public static function factory ( $ config = array ( ) ) { $ required = array ( 'base_url' ) ; $ config = Collection :: fromConfig ( $ config , array ( ) , $ required ) ; $ client = new self ( $ config -> get ( 'base_url' ) ) ; $ cookiePlugin = new CookiePlugin ( new ArrayCookieJar ( ) ) ; $ client -> addSubscriber ( $ cookiePlugin ) ; $ client -> setConfig ( $ config ) ; $ client -> setUserAgent ( 'addwiki-guzzle-mediawiki-client' ) ; $ client -> setDescription ( ServiceDescription :: factory ( dirname ( __DIR__ ) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'mediawiki.json' ) ) ; return $ client ; }
Factory method to create a new MediawikiApiClient

@param array|Collection $config Configuration data. Array keys:
base_url - Base URL of web service

@throws InvalidArgumentException
@return MediawikiApiClient
Factory method to create a new MediawikiApiClient