'{scheme}://{sub}.twitter.com/{version}/', 'scheme' => 'https', 'sub' => 'api', 'version' => 1 ); $required = array('scheme', 'version', 'base_url', 'sub'); $config = Inspector::prepareConfig($config, $default, $required); //throw new \Exception('Should be a Collection:'.var_export($config,1)); $client = new self( $config->get('base_url'), $config->get('scheme'), $config->get('sub'), $config->get('version') ); $client->setConfig($config); return $client; } /** * Client constructor * * @param string $baseUrl Base URL of the web service * @param string $scheme API scheme (aka. http/https), defaults: "https" * @param string $sub API subdomain endpoint, defaults: "api" * @param string $version API version declared in endpoint url, defaults: 1 */ public function __construct($baseUrl, $scheme, $sub, $version) { parent::__construct($baseUrl); $this->scheme = $scheme; $this->sub = $sub; $this->version = $version; $this->setServiceDescriptionUsingLocalXml('twitter.commands.xml'); } }